Browse Source

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

Michael Wang 3 years ago
parent
commit
d9c479c1c0
1 changed files with 2 additions and 6 deletions
  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);
 
       if (this.uploadFileList.length > 1) {
-        if (
-          this.uploadFileList.map((v) => v.type).includes("application/pdf")
-        ) {
+        if (this.selectedFileType === "PDF") {
           console.log("PDF文件只允许单独上传");
           throw "取消";
         }
-        if (
-          this.uploadFileList.map((v) => v.type).includes("application/zip")
-        ) {
+        if (this.selectedFileType === "ZIP") {
           console.log("ZIP文件只允许单独上传");
           throw "取消";
         }