fix(aiot): 前端截图刷新添加cache-busting防止浏览器缓存

给COS预签名URL附加_t=timestamp参数,确保每次刷新截图时
浏览器不使用缓存的旧图片。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 15:47:48 +08:00
parent c586f8e77a
commit 6ca8a38fae

View File

@@ -153,7 +153,9 @@ export default {
getSnapUrl(this.cameraId, force).then(res => {
const data = res.data || res
if (data.status === 'ok' && data.url) {
this.snapUrl = data.url
// 添加时间戳防止浏览器缓存旧截图
const url = data.url
this.snapUrl = url + (url.includes('?') ? '&' : '?') + '_t=' + Date.now()
if (data.stale) {
this.$message.warning('截图为缓存数据,边缘设备可能离线')
}