mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 06:29:20 +08:00
32 lines
745 B
TypeScript
32 lines
745 B
TypeScript
import { defineConfig } from '@vben/vite-config';
|
|
|
|
export default defineConfig(async () => {
|
|
return {
|
|
application: {
|
|
// 设置API URL
|
|
apiURL: '/api',
|
|
},
|
|
vite: {
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
changeOrigin: true,
|
|
// 后端服务地址
|
|
target: 'http://localhost:8080',
|
|
ws: true,
|
|
// SSE 长连接:禁止代理空闲超时断开
|
|
timeout: 0,
|
|
proxyTimeout: 0,
|
|
},
|
|
// 静态资源代理 - 用于访问上传的图片和文件
|
|
'/uploads': {
|
|
changeOrigin: true,
|
|
target: 'http://localhost:8080',
|
|
ws: false,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|