feat(aiot): Camera接口增加cameraCode字段,getSnapUrl改用cameraCode

- Camera interface 增加 cameraCode?: string 字段
- getSnapUrl 函数参数从 (app, stream) 改为 (cameraCode)
- 截图URL查询参数从 app/stream 改为 cameraCode
- 配合后端 camera_code 重构计划

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 11:24:31 +08:00
parent 92a6031e72
commit 2583ed5335

View File

@@ -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<string> {
export async function getSnapUrl(cameraCode: string): Promise<string> {
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()}`
);