fix(aiot): 修复摄像头查询接口URL路径错误
问题:告警汇总页面仍显示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
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user