feat: 提交

This commit is contained in:
cnxianyi
2026-09-29 18:49:45 +08:00
parent 8d8fa2af47
commit 09bcf20def
17 changed files with 357 additions and 62 deletions
+10 -3
View File
@@ -1,7 +1,7 @@
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
function resolveBuildId() {
const configured = process.env.BUILD_ID?.trim().replace(/[^a-zA-Z0-9_-]/g, '')
@@ -9,9 +9,13 @@ function resolveBuildId() {
}
// https://vite.dev/config/
export default defineConfig(() => {
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
const buildId = resolveBuildId()
const apiProxyTarget = process.env.VITE_API_PROXY_TARGET?.trim() || 'https://ipad.shenynet.com'
const apiProxyTarget =
process.env.VITE_API_PROXY_TARGET?.trim() ||
env.VITE_API_PROXY_TARGET?.trim() ||
'http://127.0.0.1:18080'
return {
plugins: [vue()],
@@ -25,6 +29,9 @@ export default defineConfig(() => {
},
},
server: {
// The public HTTPS virtual host terminates TLS in Nginx and proxies to this dev server.
// Permit only that configured hostname; keep Vite's DNS-rebinding protection enabled.
allowedHosts: ['fn.xianyi.de'],
proxy: {
'/api': {
target: apiProxyTarget,