重构: video 模块走芋道网关统一鉴权,移除独立 WVP JWT 客户端
- api/video/request.ts: 删除自实现的 WVP access-token 登录/缓存/401 续期逻辑,
直接 re-export requestClient(yudao Authorization: Bearer),
wvpRequestClient 名字仅作过渡期别名,TODO 标记后续统一重命名。
- api/video/device/index.ts: 路径从 /video/device/{proxy,user,server,...} 迁移到
后端 @RequestMapping 对齐的 /video/{proxy,ai/*,server/media_server};
删除 getAlertImageUrl(老 WVP 时代产物),删除截图 URL 里的 ?access-token。
- api/video/edge/index.ts: /video/device/device/* -> /video/ai/device/*(对齐 AiEdgeDeviceController)。
- views/video/device/camera: HEAD 探活 URL 同步,补注释说明后端需对
/video/ai/roi/snap/image permitAll 或依赖 session cookie。
- vite.config: 删除 /admin-api/video/device/* 按子路径 rewrite 到 WVP:18080 的规则,
统一走 /admin-api 到芋道网关 48080;去掉 VITE_WVP_USERNAME/PASSWORD_MD5 依赖
(安全改进:凭据不再打进客户端 bundle)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -34,43 +34,9 @@ export default defineConfig(async () => {
|
||||
target: 'http://127.0.0.1:8000',
|
||||
},
|
||||
|
||||
// video/device/* -> WVP :18080(按子路径分别 rewrite)
|
||||
// 注意:更具体的路径必须写在通配路径前面
|
||||
|
||||
// 摄像头拉流代理: /admin-api/video/device/proxy -> /api/proxy
|
||||
'/admin-api/video/device/proxy': {
|
||||
changeOrigin: true,
|
||||
target: 'http://127.0.0.1:18080',
|
||||
rewrite: (path: string) =>
|
||||
path.replace('/admin-api/video/device/proxy', '/api/proxy'),
|
||||
},
|
||||
// WVP 用户认证: /admin-api/video/device/user -> /api/user
|
||||
'/admin-api/video/device/user': {
|
||||
changeOrigin: true,
|
||||
target: 'http://127.0.0.1:18080',
|
||||
rewrite: (path: string) =>
|
||||
path.replace('/admin-api/video/device/user', '/api/user'),
|
||||
},
|
||||
// 媒体服务器: /admin-api/video/device/server -> /api/server/media_server
|
||||
'/admin-api/video/device/server': {
|
||||
changeOrigin: true,
|
||||
target: 'http://127.0.0.1:18080',
|
||||
rewrite: (path: string) =>
|
||||
path.replace(
|
||||
'/admin-api/video/device/server',
|
||||
'/api/server/media_server',
|
||||
),
|
||||
},
|
||||
// ROI/算法/配置等: /admin-api/video/device -> /api/ai(通配,放最后)
|
||||
'/admin-api/video/device': {
|
||||
changeOrigin: true,
|
||||
target: 'http://127.0.0.1:18080',
|
||||
rewrite: (path: string) =>
|
||||
path.replace('/admin-api/video/device', '/api/ai'),
|
||||
},
|
||||
|
||||
// ==================== 芋道主平台 ====================
|
||||
// 所有 system/*、infra/* 等基础接口 -> 芋道后端 48080
|
||||
// 所有 system/*、infra/*、video/device/* 等业务接口 -> 芋道网关 48080
|
||||
// video 微服务已挂到 gateway,不再直连 WVP :18080
|
||||
'/admin-api': {
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/admin-api/, ''),
|
||||
|
||||
Reference in New Issue
Block a user