diff --git a/.env.development b/.env.development index 6af08f1..b145036 100644 --- a/.env.development +++ b/.env.development @@ -34,3 +34,5 @@ VITE_USER_CENTER_HOST = 'https://test.gitcode.net/child/user-center/' # ai-copilot 子应用 VITE_COPILOT_HOST = 'https://test.gitcode.net/child/aichat-app/' + +VITE_BASE_URL=/ diff --git a/.env.production b/.env.production index 8f9eba1..13fca4e 100644 --- a/.env.production +++ b/.env.production @@ -36,3 +36,5 @@ VITE_USER_CENTER_HOST = 'https://usercenter-app.gitcode.com' # ai-copilot 子应用 VITE_COPILOT_HOST = 'https://copilot-app.gitcode.com' + +VITE_BASE_URL=/openRepoPortal/ diff --git a/vite.config.ts b/vite.config.ts index e99d4c1..1002d4a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,8 +11,9 @@ const fs = require('node:fs') export default (config: any) => { const env = loadEnv(config.mode, process.cwd()); + console.log(env) return defineConfig({ - base: '/openRepoPortal/', // 确保与 Nginx 配置匹配 + base: env.VITE_BASE_URL, plugins: [ vue({ template: {