diff --git a/business-css/frontend/vite.config.ts b/business-css/frontend/vite.config.ts index 5df1cfe..9310dac 100644 --- a/business-css/frontend/vite.config.ts +++ b/business-css/frontend/vite.config.ts @@ -17,6 +17,10 @@ export default ({ mode }: ConfigEnv): UserConfig => { symbolId: 'icon-[dir]-[name]' }) ], + define: { + // 为所有模块注入 global 变量 + global: 'window' + }, // 本地反向代理解决浏览器跨域限制 server: { host: '0.0.0.0', @@ -27,7 +31,7 @@ export default ({ mode }: ConfigEnv): UserConfig => { // 线上API地址 // target: 'http://192.168.1.166:8090/', // 本地API地址 - target: 'http://localhost:8090', + target: 'http://192.168.1.76:8090', changeOrigin: true, rewrite: path => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')