Browse Source

404page. 没有底照,又需要进行照片比对,禁止进入考试。剩余考试次数为0,不进入系统。

Michael Wang 6 năm trước cách đây
mục cha
commit
bacaeb6af6

+ 10 - 2
src/features/OnlineExam/OnlineExamList.vue

@@ -19,7 +19,7 @@
           <td>{{ course.allowExamCount }}</td>
           <td style="min-width: 180px">
             <div style="display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px">
-              <i-button class="qm-primary-button" :disabled="!courseInBetween(course)" @click="enterExam(course)">进入考试</i-button>
+              <i-button class="qm-primary-button" :disabled="!courseInBetween(course) || course.allowExamCount < 1" @click="enterExam(course)">进入考试</i-button>
               <i-poptip trigger="hover" placement="left" class="online-exam-list-override-poptip">
                 <i-button class="qm-primary-button" style="width: 100%">客观分</i-button>
                 <ecs-online-exam-result-list slot="content" :examStudentId="course.examStudentId"></ecs-online-exam-result-list>
@@ -39,7 +39,7 @@ import { createNamespacedHelpers } from "vuex";
 import OnlineExamResultList from "./OnlineExamResultList.vue";
 import OnlineExamFaceCheckModal from "./OnlineExamFaceCheckModal.vue";
 import moment from "moment";
-
+import { mapState as globalMapState } from "vuex";
 const { mapState, mapMutations } = createNamespacedHelpers("examHomeModule");
 
 export default {
@@ -79,6 +79,13 @@ export default {
 
       // TODO: 待确认. 前端控制展示“是否进入考试”。后端控制不在有效期内不准访问。
       if (course.faceEnable) {
+        // if 人脸检测 && 没有底照,提示,并返回
+        if (!this.user.photoPath) {
+          this.$Message.info(
+            "本场考试需要进行人脸检测,但是您没有上传底照,请联系老师!"
+          );
+          return;
+        }
         // open face check modal, then
         // if 人脸识别失败 && 考试开启强制人脸识别 return
         // if 人脸识别失败 && 考试未开启强制人脸识别
@@ -112,6 +119,7 @@ export default {
     }
   },
   computed: {
+    ...globalMapState(["user"]),
     ...mapState(["faceCheckModalOpen"])
   },
   components: {

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

@@ -102,6 +102,8 @@ export default {
     } catch (error) {
       console.log(error);
       this.$Message.error(error.message);
+      this.$router.back();
+      return;
     }
     const paperStruct = await this.$http.get(
       "/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +

+ 32 - 2
src/views/NotFoundComponent.vue

@@ -1,5 +1,35 @@
 <template>
-  <div class="404">
-    <h1>404 not found</h1>
+  <div class="page-404">
+    <h1>页面不存在!</h1>
+
+    <br>
+    <br>
+    <div v-if="domain">
+      <i-button size="large" class="qm-primary-button" long @click="goLogin">返回登录页</i-button>
+    </div>
+
+    <div v-else>
+      请关闭页面,重新登录!
+    </div>
   </div>
 </template>
+
+<script>
+export default {
+  name: "page404",
+  data() {
+    return { domain: localStorage.getItem("domain") };
+  },
+  methods: {
+    goLogin() {
+      this.$router.push("/login/" + localStorage.getItem("domain"));
+    }
+  }
+};
+</script>
+
+<style scoped>
+.page-404 {
+  padding-top: 50px;
+}
+</style>