From 2583ed53353a89d5edd6abb572bd28537f93c6b5 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Fri, 13 Feb 2026 11:24:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(aiot):=20Camera=E6=8E=A5=E5=8F=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0cameraCode=E5=AD=97=E6=AE=B5,getSnapUrl=E6=94=B9?= =?UTF-8?q?=E7=94=A8cameraCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Camera interface 增加 cameraCode?: string 字段 - getSnapUrl 函数参数从 (app, stream) 改为 (cameraCode) - 截图URL查询参数从 app/stream 改为 cameraCode - 配合后端 camera_code 重构计划 Co-Authored-By: Claude Opus 4.6 --- apps/web-antd/src/api/aiot/device/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/web-antd/src/api/aiot/device/index.ts b/apps/web-antd/src/api/aiot/device/index.ts index ccf6fbedb..7066818f4 100644 --- a/apps/web-antd/src/api/aiot/device/index.ts +++ b/apps/web-antd/src/api/aiot/device/index.ts @@ -29,6 +29,7 @@ export namespace AiotDeviceApi { type?: string; // 'default' | 'ffmpeg' app?: string; stream?: string; + cameraCode?: string; // 摄像头唯一编码 srcUrl?: string; timeout?: number; rtspType?: string; // '0'=TCP, '1'=UDP, '2'=Multicast @@ -189,15 +190,11 @@ export function deleteRoi(roiId: string) { * 获取摄像头截图 URL * 截图接口需要认证,通过 query param 传递 access-token */ -export async function getSnapUrl( - app: string, - stream: string, -): Promise { +export async function getSnapUrl(cameraCode: string): Promise { const token = await getWvpToken(); return ( `${apiURL}/aiot/device/roi/snap` + - `?app=${encodeURIComponent(app)}` + - `&stream=${encodeURIComponent(stream)}` + + `?cameraCode=${encodeURIComponent(cameraCode)}` + `&access-token=${encodeURIComponent(token)}` + `&t=${Date.now()}` );