From d2982f847694bd3f5d297b736c13b11b0bcf8b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Thu, 4 Dec 2025 13:58:32 +0800 Subject: [PATCH] fix; bug --- .../image-preview/preview-detail.vue | 19 +++++++-------- src/pages/analytics/study.vue | 23 +++++++++++++++---- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/components/image-preview/preview-detail.vue b/src/components/image-preview/preview-detail.vue index 80ea81aa..5b369f42 100644 --- a/src/components/image-preview/preview-detail.vue +++ b/src/components/image-preview/preview-detail.vue @@ -22,6 +22,7 @@ import { useStorageStore } from "@/store/storage.js" import { get_base_url } from '@/api/request.js' import imagePreviewVue from './image-preview.vue' + import { getToken } from '@/common/common.js' export default { name:"video-preview", components:{imagePreviewVue}, @@ -74,11 +75,11 @@ handler(newval, oldval) { if(this.fileType === 'image'){ if (newval.indexOf('/') === 0) { - this.fileUrlShow = this.base_url + newval; + this.fileUrlShow = this.base_url + newval + '?tk=' + getToken(); return; } if (newval.indexOf('http') === 0) { - this.fileUrlShow = newval; + this.fileUrlShow = newval + '?tk=' + getToken(); return; } if (newval && this.watching) { @@ -87,7 +88,7 @@ } if(this.fileType === 'video'){ if(newval.indexOf('http') === 0){ - this.fileUrlShow = newval + this.fileUrlShow = newval + '?tk=' + getToken() }else{ if (newval && this.watching) { this.getPreviewUrlBlob(newval); @@ -102,9 +103,9 @@ src: { handler(newval, oldval) { if(newval.indexOf('http') === 0){ - this.fileUrlShow = newval + this.fileUrlShow = newval + '?tk=' + getToken() }else{ - this.fileUrlShow = this.base_url + newval + this.fileUrlShow = this.base_url + newval + '?tk=' + getToken() } }, immediate: true, @@ -132,7 +133,7 @@ return; } previewCacheThumbImage(id, this.width, this.height).then((res) => { - this.fileUrlShow = res; + this.fileUrlShow = res + '?tk=' + getToken(); this.storageStore.setStorage('image', `/${id}/${this.width}/${this.height}`, res); }); } else { @@ -183,7 +184,7 @@ if (this.fileId) { let _newDate = new Date().getTime() if(this.fileId.indexOf('http') === 0){ - this.fileUrlShow = this.fileId + '?t=' + _newDate + this.fileUrlShow = this.fileId + '?tk=' + getToken() + '&t=' + _newDate }else{ this.getPreviewUrlBlob(this.fileId); } @@ -213,7 +214,7 @@ return } let _newDate = new Date().getTime() - this.fileUrlShow = getPreviewFileUrl(this.fileId)+'?t=' + _newDate + this.fileUrlShow = getPreviewFileUrl(this.fileId) + '?tk=' + getToken() + '&t=' + _newDate // downloadFile(id).then(res=>{ // this.fileUrlShow = res.tempFilePath // this.storageStore.setStorage('video', id, this.fileUrlShow) @@ -222,7 +223,7 @@ getPreviewFileUrlNow(id){ let _newDate = new Date().getTime() if(id.indexOf('http') === 0){ - this.fileUrlShow = id + '?t=' + _newDate + this.fileUrlShow = id + '?tk=' + getToken() + '&t=' + _newDate return } if (id && this.watching) { diff --git a/src/pages/analytics/study.vue b/src/pages/analytics/study.vue index f9bad360..94896e34 100644 --- a/src/pages/analytics/study.vue +++ b/src/pages/analytics/study.vue @@ -6,10 +6,11 @@ - + + +