瀏覽代碼

考试前检查底照是否合格

Michael Wang 6 年之前
父節點
當前提交
ee2390e1f9

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

@@ -85,9 +85,7 @@ export default {
 
 <style scoped>
 .container {
-  display: grid;
-  justify-items: center;
-  grid-template-columns: 1fr;
+  margin: 0 auto;
   width: 80vw;
   /* height: 100vh; */
 }

+ 7 - 2
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -25,7 +25,7 @@
     </Modal>
   </div>
   <div v-else>
-    正在等待数据返回...
+    正在等待数据返回... <i-button class="qm-primary-button" v-if="timeouted" @click="reloadPage">重试</i-button>
   </div>
 </template>
 
@@ -44,7 +44,7 @@ const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
 export default {
   name: "ExamingHome",
   data() {
-    return { showFaceId: false, faceEnable: false };
+    return { showFaceId: false, faceEnable: false, timeouted: false };
   },
   async created() {
     // if (!this.$route.params.order) {
@@ -52,6 +52,7 @@ export default {
     //   this.$router.push(this.$route.fullPath + "/order/1");
     //   return;
     // }
+    this.timeoutTimeout = setTimeout(() => (this.timeouted = true), 30 * 1000);
     await this.initData();
 
     // 仅在线上使用活体检测
@@ -115,6 +116,7 @@ export default {
     // });
   },
   beforeDestroy() {
+    clearTimeout(this.timeoutTimeout);
     clearInterval(this.submitInterval);
     clearInterval(this.snapInterval);
     clearTimeout(this.faceIdMsgTimeout);
@@ -320,6 +322,9 @@ export default {
           eq => eq.order == this.$route.params.order // number == string
         )
       );
+    },
+    reloadPage() {
+      window.location.reload();
     }
   },
   computed: {

+ 18 - 0
src/features/OnlineExam/OnlineExamList.vue

@@ -86,6 +86,24 @@ export default {
           );
           return;
         }
+
+        const faceLiveness = await this.$http.get(
+          "/api/ecs_exam_work/exam/examOrgProperty/" +
+            course.examId +
+            `/IS_FACE_VERIFY`
+        );
+        if (faceLiveness.data) {
+          const checkBasePhoto = (await this.$http.get(
+            "/api/ecs_oe_student/examFaceLivenessVerify/checkFaceLiveness"
+          )).data;
+          if (!checkBasePhoto.success) {
+            this.$Message.error(
+              "您上传的底照不符合活体检测的要求,请联系老师!"
+            );
+            return;
+          }
+        }
+
         // open face check modal, then
         // if 人脸识别失败 && 考试开启强制人脸识别 return
         // if 人脸识别失败 && 考试未开启强制人脸识别

+ 2 - 1
src/utils/axios.js

@@ -99,7 +99,8 @@ qmInstance.get = cachingGet(qmInstance.get, [
   /\/api\/exam_question\/question\/\?question_id/,
   /\/api\/exam_question\/paper_struct\/\?exam_record_id=/,
   /\/api\/ecs_exam_work\/exam\/\d+$/,
-  /\/api\/ecs_oe_student_face\/upyun$/
+  /\/api\/ecs_oe_student_face\/upyun$/,
+  /\/api\/ecs_oe_student\/examFaceLivenessVerify\/checkFaceLiveness$/
 ]);
 loadProgressBar(qmInstance);