python-flask和Vue两种模式初模板

This commit is contained in:
dxc
2026-01-26 17:00:12 +08:00
parent ee9f4aed3e
commit 2f8a5c55b1
36 changed files with 943 additions and 126 deletions

View File

@ -1,7 +1,23 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
})
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
// --- 新增下面这一段 server 配置 ---
server: {
proxy: {
'/api': {
target: 'http://127.0.0.1:5000', // 后端的地址
changeOrigin: true,
// 如果你的后端路径本身就包含 /api通常不需要 rewrite
// rewrite: (path) => path.replace(/^\/api/, '')
}
}
}
})