This commit is contained in:
DengDai
2025-12-08 14:45:14 +08:00
commit 519589f8f5
60 changed files with 8191 additions and 0 deletions

24
frontend/vite.config.js Normal file
View File

@@ -0,0 +1,24 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
server: {
// 新增或修改 server 部分
proxy: {
// 关键配置:将 /api 前缀的请求代理到后端服务
'/api': {
// 你的 Python Flask 后端地址
target: 'http://localhost:5000',
// 允许跨域
changeOrigin: true,
// 可选:如果你不希望路径中保留 /api可以重写。
// 但根据我们的后端设计,/api 是需要的,所以不需要下面这行。
// rewrite: (path) => path.replace(/^\/api/, ''),
},
}
}
})