Files
AI_OJ_FRONTEND/vite.config.ts
meowrain 3b6fb0cae1 feat(profile): 实现用户个人中心页面及头像上传功能
添加用户个人中心页面,包含基本信息展示和头像上传功能。主要修改包括:
1. 新增 UserProfileView 页面组件
2. 扩展用户信息接口和类型定义
3. 添加文件上传和头像更新API
4. 配置Vite代理以支持文件服务
5. 添加相关依赖(spark-md5, json-bigint)
2026-01-12 01:41:22 +08:00

46 lines
1.3 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
// https://vite.dev/config/
export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd(), "");
console.log("当前环境:", env.VITE_APP_ENV);
console.log("使用的环境配置文件为:", env.VITE_APP_CONFIG_FILE);
console.log("当前环境 API 基础 URL:", env.VITE_API_URL);
return {
define: {
__APP_ENV__: JSON.stringify(env.VITE_APP_ENV),
__API_BASE_URL__: JSON.stringify(env.VITE_API_URL),
},
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
plugins: [vue()],
server: {
host: "0.0.0.0",
port: 3000,
open: true,
// API 代理配置
proxy: {
// 代理所有 /api 开头的请求
'/api': {
target: 'http://localhost:18085', // 后端服务器地址
changeOrigin: true, // 改变请求头中的 origin
secure: false, // 支持 https
// 如果后端 API 路径不包含 /api可以重写路径
// rewrite: (path) => path.replace(/^\/api/, ''),
},
'/file': {
target: 'http://localhost:18085',
changeOrigin: true,
secure: false,
},
},
},
};
});