diff --git a/frontend/.env.production b/frontend/.env.production index 75acfd8..2b1a043 100644 --- a/frontend/.env.production +++ b/frontend/.env.production @@ -1,5 +1,5 @@ -# 正式环境接口地址 -VITE_API_BASE_URL = 'http://104.156.140.42:18888' +# 正式环境接口地址 - 自动匹配当前域名 +VITE_API_BASE_URL = '/api' # 正式环境打包名称 VITE_OUTDIR='production' diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index fab8497..571ed84 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -65,13 +65,6 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { hmr: { overlay: true }, - // 代理配置 (已直接配置 API 基础地址,不需要代理) - // proxy: { - // "/": { - // target: "http://104.156.140.42:18888/", - // changeOrigin: true, - // }, - // } }, // 依赖优化配置