From dcb8217a78252f203c5d67c3cf6c6e543fcb96b1 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Sat, 28 Feb 2026 16:27:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(aiot):=20=E6=88=AA=E5=9B=BE=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=B7=BB=E5=8A=A0force=E5=8F=82=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E7=BB=95=E8=BF=87WVP=205=E5=88=86=E9=92=9F=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getSnapUrl新增force参数,refreshSnap时传force=true, 使WVP后端跳过Redis缓存重新向Edge请求截图。 Co-Authored-By: Claude Opus 4.6 --- apps/web-antd/src/api/aiot/device/index.ts | 3 ++- apps/web-antd/src/views/aiot/device/roi/index.vue | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/web-antd/src/api/aiot/device/index.ts b/apps/web-antd/src/api/aiot/device/index.ts index 7066818f4..b25fcd0a0 100644 --- a/apps/web-antd/src/api/aiot/device/index.ts +++ b/apps/web-antd/src/api/aiot/device/index.ts @@ -190,11 +190,12 @@ export function deleteRoi(roiId: string) { * 获取摄像头截图 URL * 截图接口需要认证,通过 query param 传递 access-token */ -export async function getSnapUrl(cameraCode: string): Promise { +export async function getSnapUrl(cameraCode: string, force = false): Promise { const token = await getWvpToken(); return ( `${apiURL}/aiot/device/roi/snap` + `?cameraCode=${encodeURIComponent(cameraCode)}` + + `&force=${force}` + `&access-token=${encodeURIComponent(token)}` + `&t=${Date.now()}` ); diff --git a/apps/web-antd/src/views/aiot/device/roi/index.vue b/apps/web-antd/src/views/aiot/device/roi/index.vue index 617dc7168..9103a17c6 100644 --- a/apps/web-antd/src/views/aiot/device/roi/index.vue +++ b/apps/web-antd/src/views/aiot/device/roi/index.vue @@ -134,14 +134,14 @@ function goBack() { // ==================== 截图 ==================== -async function buildSnapUrl() { +async function buildSnapUrl(force = false) { if (cameraCode.value) { - snapUrl.value = await getSnapUrl(cameraCode.value); + snapUrl.value = await getSnapUrl(cameraCode.value, force); } } async function refreshSnap() { - await buildSnapUrl(); + await buildSnapUrl(true); } // ==================== ROI 数据加载 ====================