import { defineConfig } from '@vben/vite-config'; export default defineConfig(async () => { return { application: {}, vite: { server: { allowedHosts: true, proxy: { // ==================== Video 模块统一路由 ==================== // video/alarm, video/edge -> 告警服务 :8000(直通) '/admin-api/video/alarm': { changeOrigin: true, target: 'http://127.0.0.1:8000', }, '/admin-api/video/edge': { changeOrigin: true, target: 'http://127.0.0.1:8000', }, // 告警截图静态文件 -> 告警服务 :8000 '/uploads': { changeOrigin: true, target: 'http://127.0.0.1:8000', }, // Edge 本地截图(COS 未配置时回退)-> 告警服务 :8000 '/captures': { changeOrigin: true, target: 'http://127.0.0.1:8000', }, // COS 存储相关接口 -> 告警服务 :8000 '/admin-api/video/storage': { changeOrigin: true, target: 'http://127.0.0.1:8000', }, // ==================== 芋道主平台 ==================== // 所有 system/*、infra/*、video/device/* 等业务接口 -> 芋道网关 48080 // video 微服务已挂到 gateway,不再直连 WVP :18080 '/admin-api': { changeOrigin: true, rewrite: (path) => path.replace(/^\/admin-api/, ''), // mock代理目标地址 target: 'http://localhost:48080/admin-api', ws: true, }, }, }, }, }; });