From f00e6c3b881c67ef3651d4f812230188af01faca Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期日, 12 五月 2024 23:56:57 +0800
Subject: [PATCH] 1

---
 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