Explorar o código

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

Michael Wang %!s(int64=3) %!d(string=hai) anos
pai
achega
d9c479c1c0
Modificáronse 1 ficheiros con 2 adicións e 6 borrados
  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 "取消";
         }