Selaa lähdekoodia

检测学生端版本

Michael Wang 5 vuotta sitten
vanhempi
commit
31f02cce96
1 muutettua tiedostoa jossa 37 lisäystä ja 4 poistoa
  1. 37 4
      src/features/Login/Login.vue

+ 37 - 4
src/features/Login/Login.vue

@@ -163,6 +163,7 @@ export default {
     };
   },
   async mounted() {
+    this.examShellStats();
     // await this.checkNewVersion();
     if (localStorage.getItem("__swReload")) {
       localStorage.removeItem("__swReload");
@@ -448,9 +449,9 @@ export default {
       }
       //如果配置中配置了 DISABLE_REMOTE_ASSISTANCE
       if (
-        this.QECSConfig.PREVENT_CHEATING_CONFIG.includes[
+        this.QECSConfig.PREVENT_CHEATING_CONFIG.includes(
           "DISABLE_REMOTE_ASSISTANCE"
-        ]
+        )
       ) {
         await nativeExe("Project1.exe", checkRemoteAppTxt.bind(this));
       }
@@ -504,9 +505,9 @@ export default {
       }
       //如果配置中配置了 DISABLE_VIRTUAL_CAMERA
       if (
-        this.QECSConfig.PREVENT_CHEATING_CONFIG.includes[
+        this.QECSConfig.PREVENT_CHEATING_CONFIG.includes(
           "DISABLE_VIRTUAL_CAMERA"
-        ]
+        )
       ) {
         await nativeExe("multiCamera.exe", checkVCamTxt.bind(this));
       }
@@ -514,6 +515,38 @@ export default {
     closeApp() {
       window.close();
     },
+    examShellStats() {
+      const shellVersion = window.navigator.userAgent
+        .split(" ")
+        .find(v => v.startsWith("electron-exam-shell/"));
+      if (shellVersion) {
+        window._hmt.push([
+          "_trackEvent",
+          "登录页面",
+          "学生端版本",
+          shellVersion,
+        ]);
+      } else {
+        const chromeVersion = window.navigator.userAgent
+          .split(" ")
+          .find(v => v.startsWith("Chrome/"));
+        if (chromeVersion) {
+          window._hmt.push([
+            "_trackEvent",
+            "登录页面",
+            "学生端版本/chrome",
+            shellVersion,
+          ]);
+        } else {
+          window._hmt.push([
+            "_trackEvent",
+            "登录页面",
+            "学生端版本/其他浏览器",
+            window.navigator.userAgent,
+          ]);
+        }
+      }
+    },
   },
   computed: {
     logoPath() {