feat: 更新环境变量配置,添加 API 代理支持,新增 API 接口文件
This commit is contained in:
@@ -13,7 +13,7 @@ import { defineConfig } from "vite";
|
||||
|
||||
const env = dotenv.config({ path: `.env` }).parsed as Record<string, string>;
|
||||
|
||||
console.log("🚀 ~ file: vite.config.ts:7 ~ env:", env);
|
||||
console.log("🚀 ~ file: vite.config.ts ~ env:", env);
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
@@ -45,7 +45,7 @@ export default defineConfig({
|
||||
host: true,
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: env.API_BASE_URL,
|
||||
target: env.VITE_API_URL,
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user