fix: 图片地址调整

This commit is contained in:
杨航
2025-12-02 21:14:28 +08:00
parent 807d0c506b
commit 80dcfdde1f
2 changed files with 8 additions and 6 deletions
@@ -13,6 +13,7 @@
import { previewFile, previewCacheThumbImage } from '@/api/common.js';
import { get_base_url } from '@/api/request.js';
import { useStorageStore } from '@/store/storage.js';
import { getToken } from '@/common/common.js'
// const storageStore = useStorageStore()
export default {
@@ -53,7 +54,8 @@
imgUrlShow: '',
watching: false,
base_url: get_base_url(),
showModel: false
showModel: false,
token: getToken()
};
},
computed: {
@@ -151,16 +153,16 @@
mounted() {
if (this.imgId) {
if (this.imgId.indexOf('/') === 0) {
this.imgUrlShow = this.base_url + this.imgId;
this.imgUrlShow = this.base_url + this.imgId + '?tk=' + this.token;
} else if (this.imgId.indexOf('http') === 0) {
this.imgUrlShow = this.imgId;
this.imgUrlShow = this.imgId + '?tk=' + this.token;
} else {
this.getPreviewUrlBlob(this.imgId);
}
}
this.watching = true;
if (this.src) {
this.imgUrlShow = this.base_url + this.src;
this.imgUrlShow = this.base_url + this.src + '?tk=' + this.token;
}
}
};