fix(aiot): 截图刷新添加force参数,绕过WVP 5分钟缓存
getSnapUrl新增force参数,refreshSnap时传force=true, 使WVP后端跳过Redis缓存重新向Edge请求截图。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -190,11 +190,12 @@ export function deleteRoi(roiId: string) {
|
||||
* 获取摄像头截图 URL
|
||||
* 截图接口需要认证,通过 query param 传递 access-token
|
||||
*/
|
||||
export async function getSnapUrl(cameraCode: string): Promise<string> {
|
||||
export async function getSnapUrl(cameraCode: string, force = false): Promise<string> {
|
||||
const token = await getWvpToken();
|
||||
return (
|
||||
`${apiURL}/aiot/device/roi/snap` +
|
||||
`?cameraCode=${encodeURIComponent(cameraCode)}` +
|
||||
`&force=${force}` +
|
||||
`&access-token=${encodeURIComponent(token)}` +
|
||||
`&t=${Date.now()}`
|
||||
);
|
||||
|
||||
@@ -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 数据加载 ====================
|
||||
|
||||
Reference in New Issue
Block a user