Merge pull request #9847 from dataease/pr@dev@fix_picture-url3

fix(仪表板): 修复图片组件不能相对路径访问的问题
This commit is contained in:
王嘉豪 2024-05-24 15:44:51 +08:00 committed by GitHub
commit d96027f49a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -299,7 +299,7 @@ export function colorReverse(OldColorValue) {
}
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')
} else {
return url