forked from github/dataease
Merge pull request #9844 from dataease/pr@dev@fix_picture-url
fix(仪表板): 修复图片组件不能相对路径访问的问题
This commit is contained in:
commit
c8a67f4699
@ -3,7 +3,7 @@
|
||||
<img
|
||||
v-if="!showLink"
|
||||
:style="imageAdapter"
|
||||
:src="element.propValue"
|
||||
:src="imgUrlTrans(element.propValue)"
|
||||
>
|
||||
<a
|
||||
v-if="showLink"
|
||||
@ -13,14 +13,17 @@
|
||||
>
|
||||
<img
|
||||
:style="imageAdapter"
|
||||
:src="element.propValue"
|
||||
:src="imgUrlTrans(element.propValue)"
|
||||
>
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {imgUrlTrans} from "@/components/canvas/utils/utils";
|
||||
|
||||
export default {
|
||||
methods: {imgUrlTrans},
|
||||
props: {
|
||||
element: {
|
||||
type: Object,
|
||||
|
@ -299,7 +299,8 @@ export function colorReverse(OldColorValue) {
|
||||
}
|
||||
|
||||
export function imgUrlTrans(url) {
|
||||
if (url && typeof url === 'string' && url.indexOf('static-resource') > -1) {
|
||||
console.log('---'+url +'---'+ process.env.VUE_APP_BASE_API)
|
||||
if (url && typeof url === 'string' && url.indexOf('static-resource') > -1 && url.indexOf('http') === -1) {
|
||||
return process.env.VUE_APP_BASE_API + url.replace('/static-resource', 'static-resource')
|
||||
} else {
|
||||
return url
|
||||
|
Loading…
Reference in New Issue
Block a user