소스 검색

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

zhangjie 6 달 전
부모
커밋
376fcef5bd
4개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      src/components/SelectFile.vue
  2. 1 1
      src/components/UploadFetchFile.vue
  3. 1 1
      src/components/UploadFileView.vue
  4. 1 1
      src/modules/stmms/components/SelectFile.vue

+ 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;
       }