zhaowenrui 1 year ago
parent
commit
ccb9872841
1 changed files with 8 additions and 0 deletions
  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) {
             handleBeforeUpload(file) {
+              console.log(file)
                 // 校检文件类型
                 // 校检文件类型
                 if (this.fileType) {
                 if (this.fileType) {
                     let fileExtension = "";
                     let fileExtension = "";
@@ -174,6 +175,13 @@
                         return false;
                         return false;
                     }
                     }
                 }
                 }
+                if (file.name){
+                  const isName = file.name;
+                  if (isName.indexOf("+") != -1){
+                    this.$modal.msgError(`上传文件的文件名中不能包含'+'!`);
+                    return false;
+                  }
+                }
                 this.$modal.loading("正在上传文件,请稍候...");
                 this.$modal.loading("正在上传文件,请稍候...");
                 this.number++;
                 this.number++;
                 return true;
                 return true;