Browse Source

fix:修改uploader错误提示

lilinsen 5 years ago
parent
commit
5d9de232d6
1 changed files with 6 additions and 5 deletions
  1. 6 5
      src/utils/uploader.js

+ 6 - 5
src/utils/uploader.js

@@ -33,7 +33,7 @@ class IdaUploader {
             return function() {};
         }
     }
-   showMsg (msg) {
+   showMsg (msg) {       
        if (typeof(this.options.showMsgFn)=='function') {
            this.options.showMsgFn(msg);
        } else {
@@ -41,24 +41,25 @@ class IdaUploader {
        }
    }
    check (file) {
+       debugger
        if(Array.isArray(file)){           
            for(let key in file){
                 if (this.options.maxSize && (file[key].size > this.options.maxSize)) {
-                    this.showMsg(this.limitError);
+                    this.showMsg(this.options.limitError);
                     return false;
                 }
                 if (this.options.acceptType.length && this.options.acceptType.indexOf(file[key].type) === -1) {           
-                    this.showMsg(this.typeError);
+                    this.showMsg(this.options.typeError);
                     return false;
                 }
            }
        }else{
             if (this.options.maxSize && (file.size > this.options.maxSize)) {
-                this.showMsg(this.limitError);
+                this.showMsg(this.options.limitError);
                 return false;
             }
             if (this.options.acceptType.length && this.options.acceptType.indexOf(file.type) === -1) {           
-                this.showMsg(this.typeError);
+                this.showMsg(this.options.typeError);
                 return false;
             }
        }