Kaynağa Gözat

图片上传地址问题

XMLWAN 5 yıl önce
ebeveyn
işleme
6cd99758ba

+ 8 - 2
src/xt_pages/user/components/PatientForm.vue Dosyayı Görüntüle

1393
           if (this.isEdit) {
1393
           if (this.isEdit) {
1394
             this.form.age = parseInt(this.form.age);
1394
             this.form.age = parseInt(this.form.age);
1395
             this.form.user_sys_before_count = this.form.user_sys_before_count.toString();
1395
             this.form.user_sys_before_count = this.form.user_sys_before_count.toString();
1396
-            this.form.avatar = this.form.avatar + "?imageView2/2/w/500/h/500/q/90"
1396
+            if(this.form.avatar.indexOf('?imageView2/2/w/500/h/500/q/90')!=-1){
1397
+               this.form.avatar = this.form.avatar
1398
+            }else{
1399
+              this.form.avatar = this.form.avatar + "?imageView2/2/w/500/h/500/q/90"
1400
+            }
1401
+            console.log("form",this.form)
1397
             editPatient(this.patientID, this.form)
1402
             editPatient(this.patientID, this.form)
1398
 
1403
 
1399
               .then(response => {
1404
               .then(response => {
1470
     },
1475
     },
1471
     handleAvatarSuccess(res, file) {
1476
     handleAvatarSuccess(res, file) {
1472
       // this.imageUrl = URL.createObjectURL(file.raw);
1477
       // this.imageUrl = URL.createObjectURL(file.raw);
1473
-      this.form.avatar = this.qiniuDomain + res.url;
1478
+      this.form.avatar = this.qiniuDomain + res.url +"?imageView2/2/w/500/h/500/q/90";
1479
+      console.log("上传成功地址",this.form.avatar)
1474
       this.avatarFlag = true;
1480
       this.avatarFlag = true;
1475
       this.loading.close();
1481
       this.loading.close();
1476
     },
1482
     },