zhaowenrui 1 năm trước cách đây
mục cha
commit
ccb9872841
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      data-ui/src/views/components/FileUpload/index.vue

+ 8 - 0
data-ui/src/views/components/FileUpload/index.vue

@@ -150,6 +150,7 @@
 
             // 上传前校检格式和大小
             handleBeforeUpload(file) {
+              console.log(file)
                 // 校检文件类型
                 if (this.fileType) {
                     let fileExtension = "";
@@ -174,6 +175,13 @@
                         return false;
                     }
                 }
+                if (file.name){
+                  const isName = file.name;
+                  if (isName.indexOf("+") != -1){
+                    this.$modal.msgError(`上传文件的文件名中不能包含'+'!`);
+                    return false;
+                  }
+                }
                 this.$modal.loading("正在上传文件,请稍候...");
                 this.number++;
                 return true;