Files
iot-device-management-frontend/apps/web-antd/vite.config.mts

52 lines
1.6 KiB
TypeScript
Raw Normal View History

import { defineConfig } from '@vben/vite-config';
2024-05-19 21:20:42 +08:00
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
2025-03-18 13:06:04 +08:00
'/admin-api': {
changeOrigin: true,
2025-03-18 13:06:04 +08:00
rewrite: (path) => path.replace(/^\/admin-api/, ''),
// mock代理目标地址
2025-03-18 13:06:04 +08:00
target: 'http://localhost:48080/admin-api',
ws: true,
},
2024-05-19 21:20:42 +08:00
},
},
},
};
2024-05-19 21:20:42 +08:00
});