소스 검색

离线考试上传附件文件类型检测

Michael Wang 3 년 전
부모
커밋
d9c479c1c0
1개의 변경된 파일2개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 6
      src/features/OfflineExam/OfflineExamUpload.vue

+ 2 - 6
src/features/OfflineExam/OfflineExamUpload.vue

@@ -369,15 +369,11 @@ export default {
       // console.log(this.uploadFileList);
       // console.log(this.uploadFileList);
 
 
       if (this.uploadFileList.length > 1) {
       if (this.uploadFileList.length > 1) {
-        if (
-          this.uploadFileList.map((v) => v.type).includes("application/pdf")
-        ) {
+        if (this.selectedFileType === "PDF") {
           console.log("PDF文件只允许单独上传");
           console.log("PDF文件只允许单独上传");
           throw "取消";
           throw "取消";
         }
         }
-        if (
-          this.uploadFileList.map((v) => v.type).includes("application/zip")
-        ) {
+        if (this.selectedFileType === "ZIP") {
           console.log("ZIP文件只允许单独上传");
           console.log("ZIP文件只允许单独上传");
           throw "取消";
           throw "取消";
         }
         }