Explorar o código

是否开启活检

Michael Wang %!s(int64=5) %!d(string=hai) anos
pai
achega
38f5b224c3
Modificáronse 1 ficheiros con 17 adicións e 10 borrados
  1. 17 10
      src/features/OnlineExam/Examing/ExamingHome.vue

+ 17 - 10
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -314,6 +314,7 @@ export default {
       const [
         weixinAnswerEnabledData,
         faceCheckEnabledData,
+        faceLivenessEnabledData,
         examPropData,
         examData,
         paperStructData,
@@ -327,6 +328,10 @@ export default {
           "/api/ecs_exam_work/exam/faceCheckEnabled/" +
             this.$route.params.examId
         ),
+        this.$http.get(
+          "/api/ecs_exam_work/exam/identificationOfLivingEnabled/" +
+            this.$route.params.examId
+        ),
         this.$http.get(
           "/api/ecs_exam_work/exam/getExamPropertyFromCacheByStudentSession/" +
             this.$route.params.examId +
@@ -344,28 +349,35 @@ export default {
       const [
         weixinAnswerEnabled,
         faceCheckEnabled,
+        faceLivenessEnabled,
         examProp,
         exam,
         paperStruct,
       ] = [
         weixinAnswerEnabledData.data,
         faceCheckEnabledData.data,
+        faceLivenessEnabledData.data,
         examPropData.data,
         examData.data,
         paperStructData.data,
       ];
 
-      this.initFaceLiveness();
+      let initFaceLivenessResult = false;
+      if (faceLivenessEnabled) {
+        initFaceLivenessResult = await this.initFaceLiveness();
+      }
 
       let examQuestionList = examQuestionListData.data;
 
       if (
         weixinAnswerEnabled === undefined ||
         faceCheckEnabled === undefined ||
+        faceLivenessEnabled === undefined ||
         examProp === undefined ||
         exam === undefined ||
         paperStruct === undefined ||
-        examQuestionListData === undefined
+        examQuestionListData === undefined ||
+        initFaceLivenessResult === false
       ) {
         this.$Message.error({
           content: "获取考试和试卷信息失败",
@@ -549,7 +561,6 @@ export default {
       let faceVerifyMinute = null;
       let identificationOfLivingBodyScheme = null;
 
-      // 启用新活检
       {
         const examRecordDataId = this.$route.params.examRecordDataId;
 
@@ -578,13 +589,7 @@ export default {
       }
 
       if (identificationOfLivingBodyScheme === null) {
-        this.$Message.error({
-          content: "获取活体检测信息失败,退出登录",
-          duration: 15,
-          closable: true,
-        });
-        this.logout("?LogoutReason=获取活体检测信息失败");
-        return;
+        return false;
       }
 
       // 仅在线上使用活体检测
@@ -621,6 +626,8 @@ export default {
       //   // this.$Modal.remove();
       //   // }, this.$route.query.faceVerifyMinute * 60 * 1000); // 定时做活体检测
       // }, 5 * 1000); // 定时做活体检测
+
+      return true;
     },
     closeFaceId() {
       this.showFaceId = false;