fix(仪表板): 修复图片组件不能相对路径访问的问题

This commit is contained in:
wangjiahao 2024-05-24 15:43:47 +08:00
parent e49eb97396
commit 0f0c48169b
2 changed files with 2 additions and 2 deletions

View File

@ -447,7 +447,7 @@ export default {
icon: '', icon: '',
hyperlinks: HYPERLINKS, hyperlinks: HYPERLINKS,
mobileStyle: BASE_MOBILE_STYLE, mobileStyle: BASE_MOBILE_STYLE,
propValue: imgUrlTrans(fileUrl), propValue: fileUrl,
commonBackground: deepCopy(COMMON_BACKGROUND), commonBackground: deepCopy(COMMON_BACKGROUND),
style: { style: {
...PIC_STYLE ...PIC_STYLE

View File

@ -299,7 +299,7 @@ export function colorReverse(OldColorValue) {
} }
export function imgUrlTrans(url) { export function imgUrlTrans(url) {
if (url && typeof url === 'string' && url.indexOf('static-resource') > -1 && url.indexOf('http') === -1) { if (url && typeof url === 'string' && url.indexOf('static-resource') > -1 && url.indexOf('http') === -1 && url.indexOf('./') === -1) {
return process.env.VUE_APP_BASE_API + url.replace('/static-resource', 'static-resource') return process.env.VUE_APP_BASE_API + url.replace('/static-resource', 'static-resource')
} else { } else {
return url return url