Files
Skit-Panel/frontend/vite.config.js
DengDai 519589f8f5 init
2025-12-08 14:45:14 +08:00

25 lines
711 B
JavaScript
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 } 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/, ''),
},
}
}
})