2024-07-29 00:19:26 +08:00
|
|
|
|
import { defineConfig } from '@vben/vite-config';
|
2024-05-19 21:20:42 +08:00
|
|
|
|
|
2024-07-13 21:00:31 +08:00
|
|
|
|
export default defineConfig(async () => {
|
|
|
|
|
|
return {
|
2024-07-29 00:19:26 +08:00
|
|
|
|
application: {},
|
2024-07-13 21:00:31 +08:00
|
|
|
|
vite: {
|
|
|
|
|
|
server: {
|
2026-01-18 17:04:03 +08:00
|
|
|
|
allowedHosts: true,
|
2024-07-13 21:00:31 +08:00
|
|
|
|
proxy: {
|
重构: aiot 模块重命名为 video,WVP 凭据移至环境变量
路径重命名:
- api/aiot/{alarm,device,edge,request} → api/video/{alarm,device,edge,request}
- views/aiot/{alarm,device,edge} → views/video/{alarm,device,edge}
- vite.config.mts 代理路径 /admin-api/aiot/* → /admin-api/video/*
video/request.ts 改造:
- WVP 用户名/密码 MD5 改读 import.meta.env,不再写死在源码里
- force 截图失败时补一条 console.debug,便于回溯 COS 图片加载异常
video/alarm/index.ts 顺带清理:
- 移除无调用方的重复 API getRecentAlerts(与 getAlertPage 重叠)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 23:57:44 +08:00
|
|
|
|
// ==================== Video 模块统一路由 ====================
|
2026-02-09 10:24:47 +08:00
|
|
|
|
|
重构: aiot 模块重命名为 video,WVP 凭据移至环境变量
路径重命名:
- api/aiot/{alarm,device,edge,request} → api/video/{alarm,device,edge,request}
- views/aiot/{alarm,device,edge} → views/video/{alarm,device,edge}
- vite.config.mts 代理路径 /admin-api/aiot/* → /admin-api/video/*
video/request.ts 改造:
- WVP 用户名/密码 MD5 改读 import.meta.env,不再写死在源码里
- force 截图失败时补一条 console.debug,便于回溯 COS 图片加载异常
video/alarm/index.ts 顺带清理:
- 移除无调用方的重复 API getRecentAlerts(与 getAlertPage 重叠)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 23:57:44 +08:00
|
|
|
|
// video/alarm, video/edge -> 告警服务 :8000(直通)
|
|
|
|
|
|
'/admin-api/video/alarm': {
|
2026-02-06 16:41:00 +08:00
|
|
|
|
changeOrigin: true,
|
|
|
|
|
|
target: 'http://127.0.0.1:8000',
|
|
|
|
|
|
},
|
重构: aiot 模块重命名为 video,WVP 凭据移至环境变量
路径重命名:
- api/aiot/{alarm,device,edge,request} → api/video/{alarm,device,edge,request}
- views/aiot/{alarm,device,edge} → views/video/{alarm,device,edge}
- vite.config.mts 代理路径 /admin-api/aiot/* → /admin-api/video/*
video/request.ts 改造:
- WVP 用户名/密码 MD5 改读 import.meta.env,不再写死在源码里
- force 截图失败时补一条 console.debug,便于回溯 COS 图片加载异常
video/alarm/index.ts 顺带清理:
- 移除无调用方的重复 API getRecentAlerts(与 getAlertPage 重叠)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 23:57:44 +08:00
|
|
|
|
'/admin-api/video/edge': {
|
2026-02-06 16:41:00 +08:00
|
|
|
|
changeOrigin: true,
|
|
|
|
|
|
target: 'http://127.0.0.1:8000',
|
|
|
|
|
|
},
|
2026-02-11 09:57:29 +08:00
|
|
|
|
// 告警截图静态文件 -> 告警服务 :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
|
重构: aiot 模块重命名为 video,WVP 凭据移至环境变量
路径重命名:
- api/aiot/{alarm,device,edge,request} → api/video/{alarm,device,edge,request}
- views/aiot/{alarm,device,edge} → views/video/{alarm,device,edge}
- vite.config.mts 代理路径 /admin-api/aiot/* → /admin-api/video/*
video/request.ts 改造:
- WVP 用户名/密码 MD5 改读 import.meta.env,不再写死在源码里
- force 截图失败时补一条 console.debug,便于回溯 COS 图片加载异常
video/alarm/index.ts 顺带清理:
- 移除无调用方的重复 API getRecentAlerts(与 getAlertPage 重叠)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 23:57:44 +08:00
|
|
|
|
'/admin-api/video/storage': {
|
2026-02-11 09:57:29 +08:00
|
|
|
|
changeOrigin: true,
|
|
|
|
|
|
target: 'http://127.0.0.1:8000',
|
|
|
|
|
|
},
|
2026-02-09 10:24:47 +08:00
|
|
|
|
|
2026-04-17 09:14:00 +08:00
|
|
|
|
// ==================== 芋道主平台 ====================
|
2026-04-23 19:33:37 +08:00
|
|
|
|
// 所有 system/*、infra/*、video/device/* 等业务接口 -> 芋道网关 48080
|
|
|
|
|
|
// video 微服务已挂到 gateway,不再直连 WVP :18080
|
2025-03-18 13:06:04 +08:00
|
|
|
|
'/admin-api': {
|
2024-07-13 21:00:31 +08:00
|
|
|
|
changeOrigin: true,
|
2025-03-18 13:06:04 +08:00
|
|
|
|
rewrite: (path) => path.replace(/^\/admin-api/, ''),
|
2026-04-17 09:14:00 +08:00
|
|
|
|
// mock代理目标地址
|
2025-03-18 13:06:04 +08:00
|
|
|
|
target: 'http://localhost:48080/admin-api',
|
2024-07-13 21:00:31 +08:00
|
|
|
|
ws: true,
|
|
|
|
|
|
},
|
2024-05-19 21:20:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-07-13 21:00:31 +08:00
|
|
|
|
};
|
2024-05-19 21:20:42 +08:00
|
|
|
|
});
|