Files
16337 e54fcf1f8c feat(aiot): 告警截图展示 + 全局配置同步 + API兼容修复
- 告警列表新增截图缩略图列,支持预览大图
- 告警详情显示截图 URL 链接
- 摄像头管理页新增「同步全局配置」按钮
- 告警 API 路径修正: camera-summary → device-summary
- 告警 ID 兼容 alarmId 字符串格式
- Vite 代理新增 /uploads、/captures、/aiot/storage 路由

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

113 lines
4.1 KiB
TypeScript
Raw Permalink 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',
},
// 告警截图静态文件 -> 告警服务 :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/aiot/storage': {
changeOrigin: true,
target: 'http://127.0.0.1:8000',
},
// aiot/device/* -> WVP :18080按子路径分别 rewrite
// 注意:更具体的路径必须写在通配路径前面
// 摄像头拉流代理: /admin-api/aiot/device/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'),
},
// WVP 用户认证: /admin-api/aiot/device/user -> /api/user
'/admin-api/aiot/device/user': {
changeOrigin: true,
target: 'http://127.0.0.1:18080',
rewrite: (path: string) =>
path.replace('/admin-api/aiot/device/user', '/api/user'),
},
// 媒体服务器: /admin-api/aiot/device/server -> /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',
),
},
// ROI/算法/配置等: /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'),
},
// ==================== 系统基础路由 ====================
// 认证相关接口 -> 告警平台(测试阶段提供模拟认证)
'/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,
},
},
},
},
};
});