feat: 更新环境变量配置,添加 API 代理支持,新增 API 接口文件

This commit is contained in:
2025-12-13 16:29:23 +07:00
parent 7d60a47787
commit 378514c7b9
5 changed files with 159 additions and 3 deletions

View File

@@ -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,
},
},