|
@@ -43,9 +43,10 @@ const data = reactive<any>({
|
|
|
deviceInfo: {},//设备信息
|
|
|
again: false,//是否再次启动
|
|
|
againNum: 0,//再次启动次数
|
|
|
+ wsState: false,//WS状态
|
|
|
});
|
|
|
|
|
|
-const { faceCheckStu, faceState, direction, parameter, deviceInfo, again, againNum } = toRefs(data);
|
|
|
+const { faceCheckStu, faceState, direction, parameter, deviceInfo, again, againNum, wsState } = toRefs(data);
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
})
|
|
@@ -63,9 +64,18 @@ const getInit = async () => {
|
|
|
proxy?.$modal.msgError(`请重新登录绑定设备号后使用`);
|
|
|
return false;
|
|
|
}
|
|
|
+ faceState.value = true;
|
|
|
+ if (wsState.value) {
|
|
|
+ proxy?.$modal.msgWarning(`操作过快,请稍后重试`);
|
|
|
+ setTimeout(() => {
|
|
|
+ faceState.value = false;
|
|
|
+ }, 1000)
|
|
|
+ return false;
|
|
|
+ }
|
|
|
faceWs((e: any) => {
|
|
|
- console.log("faceWS",e)
|
|
|
+ console.log("faceWS", e)
|
|
|
if (e?.wksid) {
|
|
|
+ wsState.value = true;
|
|
|
//获取设备信息
|
|
|
startDevice({ deviceid: deviceid });
|
|
|
console.log("获取设备信息")
|
|
@@ -112,7 +122,6 @@ const getInit = async () => {
|
|
|
getCloseFace();
|
|
|
proxy?.$modal.msgWarning(`请重新人脸识别`);
|
|
|
} else {
|
|
|
- faceState.value = true;
|
|
|
openFace(handcontroller_id);
|
|
|
}
|
|
|
}
|
|
@@ -139,6 +148,9 @@ const getInit = async () => {
|
|
|
faceState.value = false;
|
|
|
}
|
|
|
}
|
|
|
+ if (e?.type == 'disconnect') {
|
|
|
+ wsState.value = false;
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
|