|
@@ -91,6 +91,10 @@ export default {
|
|
|
this.examRecordId = this.$route.params.examRecordDataId;
|
|
|
console.debug("startFaceVerify");
|
|
|
window._hmt.push(["_trackEvent", "活体检测弹出框", "弹出框"]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "弹出框",
|
|
|
+ });
|
|
|
// open websocket
|
|
|
this.openWebsocketToStartFaceIDTest();
|
|
|
|
|
@@ -103,6 +107,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "关闭框",
|
|
|
+ });
|
|
|
try {
|
|
|
if (this.ws && this.ws.readyState === 1) this.ws.close();
|
|
|
} catch (e) {
|
|
@@ -121,6 +129,10 @@ export default {
|
|
|
this.redoBtnMsg = redoMsg;
|
|
|
} else {
|
|
|
this.redoBtnMsg = "系统繁忙,请手动点击重试";
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "系统繁忙,请手动点击重试",
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
updateFaceVerifyMsg(errorMsg) {
|
|
@@ -146,6 +158,10 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"60秒超时非websocket处理结果",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "60秒超时非websocket处理结果",
|
|
|
+ });
|
|
|
var receivedMsg = response.data;
|
|
|
shouldTimeout = false;
|
|
|
this.faceTestEnd(receivedMsg);
|
|
@@ -161,6 +177,10 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"60秒超时非websocket处理结果--api失败",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "60秒超时非websocket处理结果--api失败",
|
|
|
+ });
|
|
|
});
|
|
|
}
|
|
|
if (!shouldTimeout) return;
|
|
@@ -187,6 +207,10 @@ export default {
|
|
|
duration: 30,
|
|
|
closable: true,
|
|
|
});
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "指定动作检测超时,系统退出,请重新登录",
|
|
|
+ });
|
|
|
}
|
|
|
this.logout(
|
|
|
"?LogoutReason=" +
|
|
@@ -208,6 +232,10 @@ export default {
|
|
|
"websocket的打开成功",
|
|
|
]);
|
|
|
console.log("websocket已连接");
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "websocket已连接",
|
|
|
+ });
|
|
|
};
|
|
|
this.ws.onmessage = response => {
|
|
|
console.log("faceid websocket response: ", response);
|
|
@@ -227,6 +255,10 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"websocket得到消息",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "websocket得到消息",
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -238,6 +270,10 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"websocket连接关闭",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "websocket连接关闭",
|
|
|
+ });
|
|
|
};
|
|
|
this.ws.onerror = () => {
|
|
|
window._hmt.push([
|
|
@@ -245,6 +281,10 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"websocket连接失败",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "websocket连接失败",
|
|
|
+ });
|
|
|
this.wsReconnectCount = this.wsReconnectCount || 0;
|
|
|
this.wsReconnectCount++;
|
|
|
if (!this.haveReceivedMsg && this.wsReconnectCount < 10) {
|
|
@@ -254,6 +294,11 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"websocket重新连接" + this.wsReconnectCount,
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "websocket重新连接",
|
|
|
+ detail: this.wsReconnectCount,
|
|
|
+ });
|
|
|
}
|
|
|
// this.showRedo("websocket连接异常,请手动点击重试");
|
|
|
};
|
|
@@ -268,12 +313,22 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"关闭websocket异常",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "关闭websocket异常",
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
* 指定动作检测结束
|
|
|
*/
|
|
|
faceTestEnd(receivedMsg) {
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "指定动作检测结束",
|
|
|
+ verifyCount: receivedMsg.verifyCount,
|
|
|
+ verifyResult: receivedMsg.verifyResult,
|
|
|
+ });
|
|
|
if (receivedMsg.verifyCount == 1) {
|
|
|
if (receivedMsg.verifyResult == "TIME_OUT") {
|
|
|
this.$Message.error({
|
|
@@ -348,8 +403,16 @@ export default {
|
|
|
if (result != "SUCCESS") {
|
|
|
this.logout("?LogoutReason=活体检测失败");
|
|
|
window._hmt.push(["_trackEvent", "活体检测弹出框", "活体检测失败"]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "活体检测失败",
|
|
|
+ });
|
|
|
} else {
|
|
|
window._hmt.push(["_trackEvent", "活体检测弹出框", "活体检测成功"]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "活体检测成功",
|
|
|
+ });
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
@@ -363,6 +426,11 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"上传指定动作检测结果出错!",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "上传指定动作检测结果出错!",
|
|
|
+ });
|
|
|
+ console.log("上传指定动作检测结果出错!");
|
|
|
this.logout("?LogoutReason=上传指定动作检测结果出错!");
|
|
|
});
|
|
|
},
|
|
@@ -372,6 +440,10 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"FaceID页面iframe加载成功",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "FaceID页面iframe加载成功",
|
|
|
+ });
|
|
|
|
|
|
clearInterval(this.timeCountInterval);
|
|
|
this.timeCount = 60; //指定动作检测倒计时60秒
|
|
@@ -408,6 +480,10 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"网络异常-getFaceVerifyToken",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "网络异常-getFaceVerifyToken",
|
|
|
+ });
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
@@ -424,6 +500,10 @@ export default {
|
|
|
duration: 15,
|
|
|
closable: true,
|
|
|
});
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "获取底照token失败,请重新登录!",
|
|
|
+ });
|
|
|
this.logout("?LogoutReason=获取底照token失败,请重新登录!");
|
|
|
return;
|
|
|
}
|
|
@@ -436,6 +516,10 @@ export default {
|
|
|
duration: 15,
|
|
|
closable: true,
|
|
|
});
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "您上传的底照不适合做活体检测,请联系老师!",
|
|
|
+ });
|
|
|
this.logout("?LogoutReason=您上传的底照不适合做活体检测,请联系老师!");
|
|
|
return;
|
|
|
}
|
|
@@ -467,6 +551,10 @@ export default {
|
|
|
"活体检测弹出框",
|
|
|
"网络异常-加载失败",
|
|
|
]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "网络异常-加载失败",
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -476,6 +564,10 @@ export default {
|
|
|
clearTimeout(this.iframeDomReadyTimeout);
|
|
|
this.showRedo("网络异常,请手动点击重试");
|
|
|
window._hmt.push(["_trackEvent", "活体检测弹出框", "网络异常"]);
|
|
|
+ this.logger({
|
|
|
+ page: "活体检测弹出框",
|
|
|
+ action: "网络异常",
|
|
|
+ });
|
|
|
}
|
|
|
}, 30 * 1000);
|
|
|
|