소스 검색

修改部署中心上传包大小限制

xujie 1 년 전
부모
커밋
5f5d79912f
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      src/views/deploy/package/index.vue

+ 5 - 4
src/views/deploy/package/index.vue

@@ -148,7 +148,7 @@
         <!-- 上传提示 -->
         <div class="el-upload__tip" slot="tip" v-if="showTip">
           文件
-          <template v-if="fileSize">大小不超过<b style="color: #f56c6c">{{ fileSize }}MB</b></template>
+          <template v-if="fileSize">大小不超过<b style="color: #f56c6c">{{ fileSize }}GB</b></template>
           <template v-if="fileType"> 格式为<b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
           的文件
         </div>
@@ -180,7 +180,7 @@ export default {
   dicts: [],
   data() {
     return {
-      fileSize: 1000,
+      fileSize: 2,
       fileType: ['zip'],
       isShowTip: true,
       // 遮罩层
@@ -342,9 +342,10 @@ export default {
       }
       // 校检文件大小
       if (this.fileSize) {
-        const isLt = file.size / 1024 / 1024 < this.fileSize;
+        const maxSize = this.fileSize * 1024 * 1024 * 1024;
+        const isLt = file.size < maxSize;
         if (!isLt) {
-          this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
+          this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} GB!`);
           return false;
         }
       }