fix; bug
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user