Browse Source

答题页检测执行文件的完整性

Michael Wang 3 years ago
parent
commit
68fa1e95f7
1 changed files with 15 additions and 0 deletions
  1. 15 0
      src/features/OnlineExam/Examing/ExamingHome.vue

+ 15 - 0
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -114,6 +114,8 @@ import { createNamespacedHelpers, mapState as globalMapState } from "vuex";
 const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
 import nativeExe, { fileExists } from "@/utils/nativeExe";
 import { REMOTE_APP_NAME } from "@/constants/constant-namelist";
+import { STRICT_CHECK_HOSTS } from "@/constants/constants";
+import { checkMainExe } from "@/utils/util";
 
 export default {
   name: "ExamingHome",
@@ -351,6 +353,7 @@ export default {
     clearInterval(this.initSnapInterval);
     clearInterval(this.snapInterval);
     clearTimeout(this.faceIdMsgTimeout);
+    clearTimeout(this.checkMainTimeout);
     clearTimeout(this.faceIdDivTimeout);
     clearTimeout(this.startVideoAfterDelayTimeout);
     clearInterval(this.checkRemoteAppInterval);
@@ -487,6 +490,18 @@ export default {
           (window.innerWidth === window.outerWidth &&
             window.innerHeight === window.outerHeight),
       });
+      this.checkMainTimeout = setTimeout(() => {
+        if (STRICT_CHECK_HOSTS.includes(window.location.hostname)) {
+          if (!checkMainExe()) {
+            this.$http.post(
+              "/api/ecs_oe_student/client/exam/process/discipline"
+            );
+            this.logger({
+              action: "答题页面discipline",
+            });
+          }
+        }
+      }, 60 * 1000);
 
       exam.WEIXIN_ANSWER_ENABLED = weixinAnswerEnabled;