Files
iot-device-management-frontend/apps/web-antd/vite.config.mts
16337 f7bfde0135 feat(aiot-device): 摄像头管理增加增删改功能
- Camera 接口扩展完整字段(type、timeout、rtspType、enable 等)
- 新增 saveCamera、deleteCamera、getMediaServerList API
- 摄像头管理页面增加添加/编辑弹窗(表单含代理类型、拉流地址、RTSP方式等)
- 增加删除确认对话框
- Vite 代理增加媒体服务器 API 转发规则

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:51:37 +08:00

89 lines
3.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from '@vben/vite-config';
export default defineConfig(async () => {
return {
application: {},
vite: {
server: {
allowedHosts: true,
proxy: {
// ==================== AIoT 统一路由 ====================
// aiot/alarm, aiot/edge -> 告警服务 :8000直通
'/admin-api/aiot/alarm': {
changeOrigin: true,
target: 'http://127.0.0.1:8000',
},
'/admin-api/aiot/edge': {
changeOrigin: true,
target: 'http://127.0.0.1:8000',
},
// aiot/device/proxy -> WVP :18080rewrite: /admin-api/aiot/device/proxy -> /api/proxy
// 摄像头拉流代理接口在 /api/proxy 下,需单独匹配
'/admin-api/aiot/device/proxy': {
changeOrigin: true,
target: 'http://127.0.0.1:18080',
rewrite: (path: string) =>
path.replace('/admin-api/aiot/device/proxy', '/api/proxy'),
},
// aiot/device/server -> WVP :18080rewrite: -> /api/server/media_server
'/admin-api/aiot/device/server': {
changeOrigin: true,
target: 'http://127.0.0.1:18080',
rewrite: (path: string) =>
path.replace('/admin-api/aiot/device/server', '/api/server/media_server'),
},
// aiot/device -> WVP :18080rewrite: /admin-api/aiot/device -> /api/ai
'/admin-api/aiot/device': {
changeOrigin: true,
target: 'http://127.0.0.1:18080',
rewrite: (path: string) =>
path.replace('/admin-api/aiot/device', '/api/ai'),
},
// aiot/video -> WVP :18080rewrite: /admin-api/aiot/video -> /api
'/admin-api/aiot/video': {
changeOrigin: true,
target: 'http://127.0.0.1:18080',
rewrite: (path: string) =>
path.replace('/admin-api/aiot/video', '/api'),
},
// ==================== 系统基础路由 ====================
// 认证相关接口 -> 告警平台(测试阶段提供模拟认证)
'/admin-api/system/auth': {
changeOrigin: true,
target: 'http://127.0.0.1:8000',
ws: true,
},
// 租户相关接口 -> 告警平台(测试阶段返回默认值)
'/admin-api/system/tenant': {
changeOrigin: true,
target: 'http://127.0.0.1:8000',
},
// 验证码接口 -> 告警平台(测试阶段返回禁用状态)
'/admin-api/system/captcha': {
changeOrigin: true,
target: 'http://127.0.0.1:8000',
},
// 字典数据接口 -> 告警平台(测试阶段返回空)
'/admin-api/system/dict-data': {
changeOrigin: true,
target: 'http://127.0.0.1:8000',
},
// 消息通知接口 -> 告警平台(测试阶段返回空)
'/admin-api/system/notify-message': {
changeOrigin: true,
target: 'http://127.0.0.1:8000',
},
// 其他接口 -> 芋道主平台(未来对接)
// 测试阶段:这些接口会 404但不影响核心功能
'/admin-api': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/admin-api/, ''),
target: 'http://localhost:48080/admin-api',
ws: true,
},
},
},
},
};
});