From 4eaad734ba3ae25bfd7a665f9b6e77380d1653aa Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Tue, 24 Feb 2026 13:34:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(aiot):=20=E4=BF=AE=E5=A4=8D=E6=91=84?= =?UTF-8?q?=E5=83=8F=E5=A4=B4=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3URL?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:告警汇总页面仍显示camera_code而非中文名称 根因:service调用WVP接口使用了错误的URL路径 - 错误URL: /admin-api/aiot/device/camera/get(前端代理路径) - 正确URL: /api/ai/camera/get(WVP实际接口路径) 说明: - /admin-api/aiot/device/* 是前端vite代理路由 - service是后端服务,应直接调用WVP真实接口路径 - 该接口已加入认证白名单,移除headers认证 修复: - 修改URL为 /api/ai/camera/get - 移除无需的Authorization headers 影响文件: - app/routers/yudao_aiot_alarm.py:375 --- app/routers/yudao_aiot_alarm.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/routers/yudao_aiot_alarm.py b/app/routers/yudao_aiot_alarm.py index bdf9f37..44f7835 100644 --- a/app/routers/yudao_aiot_alarm.py +++ b/app/routers/yudao_aiot_alarm.py @@ -370,11 +370,10 @@ async def _get_camera_info(device_id: str, current_user: dict) -> Optional[dict] if device_id.startswith("cam_"): try: async with httpx.AsyncClient(timeout=5) as client: - # 调用 WVP 查询单个摄像头的 API + # 调用 WVP 查询单个摄像头的 API(无需认证,已加白名单) resp = await client.get( - f"{WVP_API_BASE}/admin-api/aiot/device/camera/get", + f"{WVP_API_BASE}/api/ai/camera/get", params={"cameraCode": device_id}, - headers=headers ) if resp.status_code == 200: data = resp.json()