diff --git a/.env.development b/.env.development index 9544eb57..ecf57326 100644 --- a/.env.development +++ b/.env.development @@ -6,3 +6,8 @@ VITE_APP_PORT = 3000 # 代理前缀 VITE_APP_BASE_API = '/dev-api' + +# 线上接口地址 +VITE_APP_API_URL = http://vapi.youlai.tech +# 开发接口地址 +# VITE_APP_API_URL = http://localhost:8989 diff --git a/vite.config.ts b/vite.config.ts index e212dd3b..4c511bde 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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), ""), },