Преглед изворни кода

fix: 上传文件大小提示错误修复

zhangjie пре 6 месеци
родитељ
комит
376fcef5bd

+ 1 - 1
src/components/SelectFile.vue

@@ -71,7 +71,7 @@ export default {
 
       if (file.size > this.maxSize) {
         this.errorMsg =
-          "文件大小不能超过" + Math.floor(this.maxSize / 1024) + "M";
+          "文件大小不能超过" + Math.floor(this.maxSize / (1024 * 1024)) + "M";
         this.$emit("file-change", { errorMsg: this.errorMsg });
         return;
       }

+ 1 - 1
src/components/UploadFetchFile.vue

@@ -112,7 +112,7 @@ export default {
     },
     handleExceededSize() {
       const content =
-        "文件大小不能超过" + Math.floor(this.maxSize / 1024) + "M";
+        "文件大小不能超过" + Math.floor(this.maxSize / (1024 * 1024)) + "M";
       this.res = {
         success: false,
         message: content,

+ 1 - 1
src/components/UploadFileView.vue

@@ -183,7 +183,7 @@ export default {
     },
     handleExceededSize() {
       const content =
-        "文件大小不能超过" + Math.floor(this.maxSize / 1024) + "M";
+        "文件大小不能超过" + Math.floor(this.maxSize / (1024 * 1024)) + "M";
       this.res = {
         success: false,
         message: content,

+ 1 - 1
src/modules/stmms/components/SelectFile.vue

@@ -71,7 +71,7 @@ export default {
 
       if (file.size > this.maxSize) {
         this.errorMsg =
-          "文件大小不能超过" + Math.floor(this.maxSize / 1024) + "M";
+          "文件大小不能超过" + Math.floor(this.maxSize / (1024 * 1024)) + "M";
         this.$emit("file-change", { errorMsg: this.errorMsg });
         return;
       }