浏览代码

global logout. 人脸比对失败后,如果是强制比对的话,那么对话框不消失。

Michael Wang 6 年之前
父节点
当前提交
5104c32a81

+ 0 - 3
src/components/MainLayout/MainLayout.vue

@@ -69,9 +69,6 @@ export default {
     goChangePwd() {
       this.$router.push("/password");
     },
-    logout() {
-      this.$router.push("/login/" + localStorage.getItem("domain"));
-    },
     goBack() {
       window.history.back();
     }

+ 11 - 19
src/features/OnlineExam/Examing/ExamPaper.vue

@@ -47,40 +47,32 @@ export default {
     async initData() {
       const [
         examData,
-        paperStructData
-        // examQuestionListData
+        paperStructData,
+        examQuestionListData
       ] = await Promise.all([
         this.$http.get("/api/ecs_exam_work/exam/" + this.examId),
         this.$http.get(
           "/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
             this.examRecordDataId
+        ),
+        this.$http.get(
+          "/api/ecs_oe_admin/examRecordQuestions/getExamRecordQuestions?examRecordDataId=" +
+            this.examRecordDataId
         )
-        // this.$http.get("/api/ecs_oe_student/examQuestion/findExamQuestionList")
       ]);
       const [exam, paperStruct] = [examData.data, paperStructData.data];
 
-      let examQuestionList = []; // examQuestionListData.data;
+      let examQuestionList = examQuestionListData.data.examQuestionEntities;
 
       if (
         exam === undefined ||
-        paperStruct === undefined
-        // ||examQuestionListData === undefined
+        paperStruct === undefined ||
+        examQuestionListData === undefined
       ) {
         this.$Message.error("获取试卷信息失败");
-        this.logout();
         return;
       }
 
-      if (exam.examType === "PRACTICE") {
-        const practiceType = (await this.$http.get(
-          "/api/ecs_exam_work/exam/examOrgProperty/" +
-            this.examId +
-            `/PRACTICE_TYPE`
-        )).data;
-        this.practiceType = practiceType; // IN_PRACTICE NO_ANSWER
-        exam.practiceType = practiceType;
-      }
-
       // init subNumber
       let questionId = null;
       let i = 1;
@@ -211,13 +203,13 @@ export default {
 
 @media screen and (max-height: 768px) {
   .container {
-    grid-template-rows: 50px 1fr;
+    grid-template-rows: 50px minmax(0, 1fr);
   }
   .header {
     height: 50px;
   }
   .side {
-    grid-template-rows: 1fr 200px;
+    grid-template-rows: minmax(0, 1fr) 200px;
   }
 }
 </style>

+ 3 - 6
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -336,6 +336,8 @@ export default {
         this.submitLock = true;
       }
       try {
+        const examId = this.$route.params.examId;
+        const examRecordDataId = this.$route.params.examRecordDataId;
         const res = await this.$http.get(
           "/api/ecs_oe_student/examControl/endExam"
         );
@@ -346,9 +348,7 @@ export default {
             objectiveScore: res.data.objectiveScore
           });
           this.$router.push({
-            path: `/online-exam/exam/${
-              this.$route.params.examId
-            }/examRecordData/${this.$route.params.examRecordDataId}/end`
+            path: `/online-exam/exam/${examId}/examRecordData/${examRecordDataId}/end`
           });
           // 确保交卷成功后,不会再次交卷
           this.submitLock = true;
@@ -375,9 +375,6 @@ export default {
     },
     reloadPage() {
       window.location.reload();
-    },
-    logout() {
-      this.$router.push("/login/" + localStorage.getItem("domain"));
     }
   },
   computed: {

+ 0 - 3
src/features/OnlineExam/Examing/FaceId.vue

@@ -44,9 +44,6 @@ export default {
     this.startFaceVerify();
   },
   methods: {
-    logout() {
-      this.$router.push("/login/" + localStorage.getItem("domain"));
-    },
     showRedo(redoMsg) {
       this.showIframe = false;
       this.redoBtnDisabled = false;

+ 3 - 1
src/features/OnlineExam/OnlineExamFaceCheckModal.vue

@@ -80,10 +80,11 @@ export default {
         this.$Message.error(error);
         return;
       }
-      this.toggleFaceCheckModal(false);
+
       if (!pass) {
         this.$Message.error("人脸比对失败");
         if (!this.course.faceCheck) {
+          this.toggleFaceCheckModal(false);
           this.$Modal.confirm({
             title: "郑重承诺",
             content:
@@ -98,6 +99,7 @@ export default {
         }
         return;
       }
+      this.toggleFaceCheckModal(false);
       this.$router.push(
         `/online-exam/exam/${this.course.examId}/overview?examStudentId=${
           this.course.examStudentId

+ 1 - 1
src/features/OnlineExam/OnlineExamHome.vue

@@ -44,7 +44,7 @@ export default {
       }
     } catch (error) {
       this.$Message.error("获取断点续考信息异常,退出登录");
-      // FIXME: 整个系统的mixin,logout
+      this.logout();
       return;
     }
 

+ 2 - 2
src/features/OnlineExam/OnlineExamOverview.vue

@@ -87,8 +87,8 @@ export default {
         .map(q => q.groupScore)
         .reduce((p, c) => p + c);
     } catch (e) {
-      // FIXME: global logout
-      this.$router.back();
+      this.$Message.error("获取考试概览信息异常,退出登录");
+      this.logout();
       return;
     }
     // this.startInfo = {

+ 5 - 0
src/main.js

@@ -83,6 +83,11 @@ Vue.mixin({
         event.preventDefault();
       });
     });
+  },
+  methods: {
+    logout() {
+      this.$router.push("/login/" + localStorage.getItem("domain"));
+    }
   }
 });