From 037af3bed10918cf24629f9a7f7e207af059ee96 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期日, 14 四月 2024 17:06:32 +0800
Subject: [PATCH] update
---
src/components/scUpload/index.vue | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/components/scUpload/index.vue b/src/components/scUpload/index.vue
index 1a0a0b9..15744dc 100644
--- a/src/components/scUpload/index.vue
+++ b/src/components/scUpload/index.vue
@@ -95,7 +95,8 @@
height: this.height + "px"
},
cropperDialogVisible: false,
- cropperFile: null
+ cropperFile: null,
+ hostNew: ''
}
},
watch:{
@@ -108,15 +109,23 @@
}
},
mounted() {
- this.value = this.modelValue
- this.newFile(this.modelValue)
+ this.getHost().then(res => {
+ this.value = this.modelValue
+ this.newFile(this.modelValue)
+ })
},
methods: {
+ getHost () {
+ if (this.host) return this.hostNew = this.host
+ return this.$API.setting.component.getImgHost.get().then(res => {
+ this.hostNew = res.data + '/visual/'
+ })
+ },
newFile(url){
if(url){
this.file = {
status: "success",
- url: `${this.host}${url}`
+ url: `${this.hostNew}${url}`
}
}else{
this.file = null
--
Gitblit v1.9.3