瀏覽代碼

后台返回的考试属性,JSON格式不规范。王伟不愿意修改。前端只能做不规范的处理。

Michael Wang 5 年之前
父節點
當前提交
a007b78dec

+ 4 - 1
src/features/OfflineExam/OfflineExamUpload.vue

@@ -61,7 +61,10 @@ export default {
         `/OFFLINE_UPLOAD_FILE_TYPE`
     );
 
-    this.uploadFileFormat = res.data.OFFLINE_UPLOAD_FILE_TYPE || [];
+    this.uploadFileFormat =
+      (res.data.OFFLINE_UPLOAD_FILE_TYPE &&
+        JSON.parse(res.data.OFFLINE_UPLOAD_FILE_TYPE)) ||
+      [];
     this.uploadFileFormat = this.uploadFileFormat.map(v => v.toLowerCase());
     this.uploadFileAccept = this.uploadFileFormat
       .map(v => "application/" + v)

+ 4 - 1
src/features/OnlineExam/Examing/ExamingEnd.vue

@@ -137,7 +137,10 @@ export default {
           examId +
           `/IS_OBJ_SCORE_VIEW`
       );
-      this.showObjectScore = showObjectScore.data.IS_OBJ_SCORE_VIEW || false;
+      this.showObjectScore =
+        (showObjectScore.data.IS_OBJ_SCORE_VIEW &&
+          JSON.parse(showObjectScore.data.IS_OBJ_SCORE_VIEW)) ||
+        false;
 
       if (this.examResult.isWarn) {
         const cheatingRemark = await this.$http.get(

+ 9 - 4
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -126,7 +126,10 @@ export default {
       return;
     }
 
-    if (faceEnable.data.IS_FACE_ENABLE) {
+    if (
+      faceEnable.data.IS_FACE_ENABLE &&
+      JSON.parse(faceEnable.data.IS_FACE_ENABLE)
+    ) {
       this.faceEnable = true;
 
       // setTimeout(() => {
@@ -311,8 +314,8 @@ export default {
             this.$route.params.examId +
             `/PRACTICE_TYPE`
         )).data;
-        this.practiceType = practiceType.SNAPSHOT_INTERVAL; // IN_PRACTICE NO_ANSWER
-        exam.practiceType = practiceType.SNAPSHOT_INTERVAL;
+        this.practiceType = practiceType.PRACTICE_TYPE; // IN_PRACTICE NO_ANSWER
+        exam.practiceType = practiceType.PRACTICE_TYPE;
       }
 
       try {
@@ -321,7 +324,9 @@ export default {
             this.$route.params.examId +
             `/FREEZE_TIME`
         );
-        exam.freezeTime = freezeTimeData.data.FREEZE_TIME;
+        exam.freezeTime =
+          freezeTimeData.data.FREEZE_TIME &&
+          JSON.parse(freezeTimeData.data.FREEZE_TIME);
       } catch (error) {
         console.log("获取考试冻结时间失败--忽略");
       }

+ 4 - 1
src/features/OnlineExam/OnlineExamList.vue

@@ -183,7 +183,10 @@ export default {
           });
           return;
         }
-        if (faceLiveness.data.IS_FACE_VERIFY) {
+        if (
+          faceLiveness.data.IS_FACE_VERIFY &&
+          JSON.parse(faceLiveness.data.IS_FACE_VERIFY)
+        ) {
           this.processingMessage = "正在检测底照是否满足活体检测标准...";
           let checkBasePhoto;
           try {