build(vite.config.ts): 📦 代理接口地址通过env配置文件修改

This commit is contained in:
cshaptx4869 committed 2024-03-01 13:54:38 +08:00
1 parent 9b5d10ca0b
commit 073d95d26f
2 files changed
+7 -4

No files matched your search

+2 -4
View File
@@ -51,10 +51,8 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
*/
[env.VITE_APP_BASE_API]: {
changeOrigin: true,
// 线上接口地址
target: "http://vapi.youlai.tech",
// 开发接口地址
// target: "http://localhost:8989",
// 接口地址
target: env.VITE_APP_API_URL,
rewrite: (path) =>
path.replace(new RegExp("^" + env.VITE_APP_BASE_API), ""),
},