瀏覽代碼

更多登录和退出的百度统计事件

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

+ 5 - 1
src/components/FaceRecognition/FaceRecognition.vue

@@ -202,7 +202,11 @@ export default {
               (this.lastSnapTime ? "(非初次抓拍)" : "")
           ]);
           reject("摄像头没有正常启用");
-          this.logout();
+          this.logout(
+            "?LogoutReason=" +
+              "摄像头没有正常启用-退出" +
+              (this.lastSnapTime ? "(非初次抓拍)" : "")
+          );
           return;
         }
         video.pause();

+ 1 - 1
src/components/MainLayout/MainLayout.vue

@@ -52,7 +52,7 @@
       </Poptip>
       <span style="margin: auto 20px">|</span>
       <a
-        @click="logout"
+        @click="() => this.logout('?LogoutReason=正常退出')"
         class="qm-primary-text"
         style="display: inline-block; margin-right: 20px; text-align: center;"
         >退出登录</a

+ 8 - 1
src/features/Login/Login.vue

@@ -290,6 +290,13 @@ export default {
           const user = { ...data, ...student };
           this.updateUser(user);
           window.localStorage.setItem("user-for-reload", JSON.stringify(user));
+
+          window._hmt.push([
+            "_trackEvent",
+            "登录页面",
+            "登录",
+            this.$route.query.LogoutReason
+          ]);
           await this.checkExamInProgress();
           window._hmt.push(["_trackEvent", "登录页面", "登录成功"]);
         } catch (error) {
@@ -336,7 +343,7 @@ export default {
         this.$router.push("/online-exam");
       } catch (error) {
         this.$Message.error("获取断点续考信息异常,退出登录");
-        this.logout();
+        this.logout("?LogoutReason=登录页面获取断点续考信息异常");
         return;
       }
     },

+ 4 - 4
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -109,7 +109,7 @@ export default {
       );
     } catch (error) {
       this.$Message.error("获取人脸检测设置失败");
-      this.logout();
+      this.logout("?LogoutReason=获取人脸检测设置失败");
       return;
     }
 
@@ -163,7 +163,7 @@ export default {
         }
       } catch (error) {
         this.$Message.error("获取人脸抓拍间隔设置失败");
-        this.logout();
+        this.logout("?LogoutReason=获取人脸抓拍间隔设置失败");
         return;
       }
     }
@@ -172,7 +172,7 @@ export default {
       await this.initData();
     } catch (error) {
       this.$Message.error("获取试卷信息失败,退出登录");
-      this.logout();
+      this.logout("?LogoutReason=获取试卷信息失败");
       return;
     }
 
@@ -262,7 +262,7 @@ export default {
         examQuestionListData === undefined
       ) {
         this.$Message.error("获取试卷信息失败");
-        this.logout();
+        this.logout("?LogoutReason=获取试卷信息失败");
         return;
       }
 

+ 15 - 7
src/features/OnlineExam/Examing/FaceId.vue

@@ -163,7 +163,11 @@ export default {
                 duration: 30
               });
             }
-            this.logout();
+            this.logout(
+              "?LogoutReason=" + this.faceTestEndCalled
+                ? "人脸检测超时"
+                : "人脸检测超时-可续考"
+            );
           });
       }, 60000); //60000
       /**
@@ -179,12 +183,12 @@ export default {
           )
           .then(() => {
             if (result != "SUCCESS") {
-              this.logout();
+              this.logout("?LogoutReason=人脸检测失败");
             }
           })
           .catch(() => {
             this.$Message.error("上传人脸检测结果出错!");
-            this.logout();
+            this.logout("?LogoutReason=上传人脸检测结果出错!");
           });
       };
       /**
@@ -198,13 +202,17 @@ export default {
               content: "第一次人脸检测超时,检测失败,系统退出,请重新登录",
               duration: 30
             });
-            this.logout();
+            this.logout(
+              "?LogoutReason=第一次人脸检测超时,检测失败,系统退出,请重新登录"
+            );
           } else if (receivedMsg.verifyResult == "VERIFY_FAILED") {
             this.$Message.error({
               content: "第一次人脸检测失败,系统退出,请重新登录",
               duration: 30
             });
-            this.logout();
+            this.logout(
+              "?LogoutReason=第一次人脸检测失败,系统退出,请重新登录"
+            );
           } else if (receivedMsg.verifyResult == "NOT_ONESELF") {
             this.$Message.error({
               content: "人脸检测不合格,结束考试",
@@ -269,7 +277,7 @@ export default {
         );
       } catch (error) {
         this.$Message.error("获取底照token失败,请重新登录!");
-        this.logout();
+        this.logout("?LogoutReason=获取底照token失败,请重新登录!");
         return;
       }
 
@@ -279,7 +287,7 @@ export default {
           content: "您上传的底照不适合做活体检测,请联系老师!",
           duration: 30
         });
-        this.logout();
+        this.logout("?LogoutReason=您上传的底照不适合做活体检测,请联系老师!");
         return;
       }
 

+ 11 - 1
src/features/OnlineExam/Examing/RemainTime.vue

@@ -81,11 +81,21 @@ export default {
           // 心跳异常10次则退出考试
           clearInterval(this.heartbeatInterval);
           clearInterval(this.remainTimeInterval);
+          window._hmt.push([
+            "_trackEvent",
+            "正在考试页面",
+            "心跳",
+            "失败10次-退出"
+          ]);
           this.$Modal.error({
             title: "网络连接异常",
             content: "退出考试",
             onOk: () => {
-              this.$router.push("/login/" + localStorage.getItem("domain"));
+              this.$router.push(
+                "/login/" +
+                  localStorage.getItem("domain") +
+                  "?LogoutReason=心跳失败10次-退出"
+              );
             }
           });
           return;

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

@@ -42,7 +42,7 @@
         <i-button
           style="margin: 0; margin-right: 5px"
           class="qm-primary-button"
-          @click="() => this.logout()"
+          @click="() => this.logout('?LogoutReason=验证预留手机号')"
         >
           退出系统
         </i-button>

+ 3 - 2
src/main.js

@@ -101,9 +101,10 @@ Vue.mixin({
         console.log(error);
       }
     },
-    logout() {
+    logout(cause = "") {
       localStorage.removeItem("phoneVerified");
-      this.$router.push("/login/" + localStorage.getItem("domain"));
+      window._hmt.push(["_trackEvent", "退出", cause]);
+      this.$router.push("/login/" + localStorage.getItem("domain") + cause);
     }
   }
 });