Przeglądaj źródła

图片路径判断带不带http

LiFei 4 lat temu
rodzic
commit
0aac01f87c

+ 11 - 1
src/views/hlgcompany/modules/HlgCompanyUploadContractModal.vue

@@ -325,12 +325,22 @@
             uid: uidGenerator(),
             name: getFileName(arr[a]),
             status: 'done',
-            url: this.url.imgerver +  arr[a],
+            url: this.getAvatarView(arr[a]),
             thUrl: arr[a]
           })
         }
         this.fileList = fileList
       },
+
+
+      getAvatarView(idcardPicture) {
+        if( idcardPicture.indexOf("http")!=-1){
+          return idcardPicture
+        }else{
+          return this.url.imgerver+idcardPicture
+        }
+      },
+
       handleDateChange1(time){
         this.getOneYearLaterTime(time)
       }

+ 11 - 1
src/views/hlguser/modules/HlgUserUploadContractModal.vue

@@ -339,12 +339,22 @@
             uid: uidGenerator(),
             name: getFileName(arr[a]),
             status: 'done',
-            url: this.url.imgerver +  arr[a],
+            url:  this.getAvatarView(arr[a]),
             thUrl: arr[a]
           })
         }
         this.fileList = fileList
       },
+
+
+      getAvatarView(idcardPicture) {
+        if( idcardPicture.indexOf("http")!=-1){
+          return idcardPicture
+        }else{
+          return this.url.imgerver+idcardPicture
+        }
+      },
+
       handleDateChange1(time){
         this.getOneYearLaterTime(time)
       },