1
lzhe
2024-05-13 f5edc2904945f37b164a7874d502cf002fae024e
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