页面部分实现
This commit is contained in:
16
zhandianxinxi/my-vue-app/vite.config.js
Normal file
16
zhandianxinxi/my-vue-app/vite.config.js
Normal file
@ -0,0 +1,16 @@
|
||||
// vite.config.js
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://127.0.0.1:5000', // 必须指向你的 Flask 地址
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path // 保持路径 /api 不变
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user