物料-采购件入库页面功能实现

This commit is contained in:
dxc
2026-01-27 15:50:23 +08:00
parent 2f8a5c55b1
commit 3afea217b7
45 changed files with 1522 additions and 2756 deletions

View File

@ -9,14 +9,21 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
// --- 新增下面这一段 server 配置 ---
server: {
// 【关键修改1】必须设置为 0.0.0.0,否则容器外无法访问
host: '0.0.0.0',
// 【关键修改2】显式指定端口与 docker-compose 映射保持一致
port: 5173,
proxy: {
'/api': {
target: 'http://127.0.0.1:5000', // 后端的地址
// 【关键修改3】
// 1. 'backend' 是 docker-compose.yml 里的服务名
// 2. 端口改为 8000 (Gunicorn 配置的端口)
target: 'http://backend:8000',
changeOrigin: true,
// 如果你的后端路径本身就包含 /api通常不需要 rewrite
// rewrite: (path) => path.replace(/^\/api/, '')
// 注意:如果你的 Flask 路由代码里没有写 /api 前缀(例如 @app.route('/login')
// 那么你需要取消下面这行的注释,把 /api 去掉,否则后端会收到 /api/login 报 404
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}