From a590aa0a263f51df17962ab7afff86ba7de51fa7 Mon Sep 17 00:00:00 2001 From: nanxun Date: Thu, 29 Jan 2026 22:54:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=9A=E5=88=86=E6=94=AF=E9=83=A8=E7=BD=B2=E6=97=B6=E9=9D=99?= =?UTF-8?q?=E6=80=81=E8=B5=84=E6=BA=90=E7=9A=84=E8=B7=AF=E5=BE=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/web/.env | 8 ++++---- frontend/web/vite.config.js | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/frontend/web/.env b/frontend/web/.env index d0640cb..33374ce 100644 --- a/frontend/web/.env +++ b/frontend/web/.env @@ -1,4 +1,4 @@ -VITE_API_BASE_URL = http://localhost:5202/api -VITE_SIGNALR_BASE_URL = http://localhost:5202/chat -#VITE_API_BASE_URL = http://192.168.5.116:7070/api -#VITE_SIGNALR_BASE_URL = http://192.168.5.116:7070/chat \ No newline at end of file +#VITE_API_BASE_URL = http://localhost:5202/api +#VITE_SIGNALR_BASE_URL = http://localhost:5202/chat +VITE_API_BASE_URL = https://im.test.nxsir.cn/api +VITE_SIGNALR_BASE_URL = https://im.test.nxsir.cn/chat \ No newline at end of file diff --git a/frontend/web/vite.config.js b/frontend/web/vite.config.js index e47930e..5699bc0 100644 --- a/frontend/web/vite.config.js +++ b/frontend/web/vite.config.js @@ -4,9 +4,20 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vueDevTools from 'vite-plugin-vue-devtools' + // https://vite.dev/config/ -export default defineConfig({ - base: './', +export default defineConfig(( { command } ) => { + let branch = process.env.BRANCH || 'main' + + // 1️⃣ dev 模式:永远 / + if (command === 'serve') { + branch = '/' + }else{ + branch = `/${branch}/` + } + + return { + base: branch, build: { sourcemap: true }, @@ -19,4 +30,5 @@ export default defineConfig({ '@': fileURLToPath(new URL('./src', import.meta.url)) }, }, +} })