|
@@ -212,12 +212,23 @@ export default {
|
|
clearInterval(this.timeCountInterval);
|
|
clearInterval(this.timeCountInterval);
|
|
this.$emit("closeFaceId");
|
|
this.$emit("closeFaceId");
|
|
this.closeWS();
|
|
this.closeWS();
|
|
|
|
+
|
|
|
|
+ window._hmt.push([
|
|
|
|
+ "_trackEvent",
|
|
|
|
+ "活体检测弹出框",
|
|
|
|
+ "websocket得到消息",
|
|
|
|
+ ]);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
// 重复关闭不会报错
|
|
// 重复关闭不会报错
|
|
this.ws.onclose = function() {
|
|
this.ws.onclose = function() {
|
|
console.log("websocket连接已关闭...");
|
|
console.log("websocket连接已关闭...");
|
|
|
|
+ window._hmt.push([
|
|
|
|
+ "_trackEvent",
|
|
|
|
+ "活体检测弹出框",
|
|
|
|
+ "websocket连接关闭",
|
|
|
|
+ ]);
|
|
};
|
|
};
|
|
this.ws.onerror = () => {
|
|
this.ws.onerror = () => {
|
|
window._hmt.push([
|
|
window._hmt.push([
|
|
@@ -225,12 +236,14 @@ export default {
|
|
"活体检测弹出框",
|
|
"活体检测弹出框",
|
|
"websocket连接失败",
|
|
"websocket连接失败",
|
|
]);
|
|
]);
|
|
- if (!this.haveReceivedMsg) {
|
|
|
|
|
|
+ this.wsReconnectCount = this.wsReconnectCount || 0;
|
|
|
|
+ this.wsReconnectCount++;
|
|
|
|
+ if (!this.haveReceivedMsg && this.wsReconnectCount < 10) {
|
|
this.ws = new WebSocket(VUE_APP_WK_SERVER_SOCKET + this.examRecordId);
|
|
this.ws = new WebSocket(VUE_APP_WK_SERVER_SOCKET + this.examRecordId);
|
|
window._hmt.push([
|
|
window._hmt.push([
|
|
"_trackEvent",
|
|
"_trackEvent",
|
|
"活体检测弹出框",
|
|
"活体检测弹出框",
|
|
- "websocket重新连接",
|
|
|
|
|
|
+ "websocket重新连接" + this.wsReconnectCount,
|
|
]);
|
|
]);
|
|
}
|
|
}
|
|
// this.showRedo("websocket连接异常,请手动点击重试");
|
|
// this.showRedo("websocket连接异常,请手动点击重试");
|