|
@@ -197,7 +197,7 @@ const getLogout = async () => {
|
|
|
*/
|
|
|
const getTips = () => {
|
|
|
getClearTimer('nextItem');
|
|
|
- let myTime = 4000;
|
|
|
+ let myTime = 10000;
|
|
|
let num = 0;
|
|
|
timerManager.value.nextItem = setInterval(() => {
|
|
|
if (router.currentRoute.value.path == '/gesture') {
|
|
@@ -244,22 +244,33 @@ const getErweima = () => {
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
//加载设备WS
|
|
|
- handWs((e: any) => {
|
|
|
+ handWs(async (e: any) => {
|
|
|
//发送设备
|
|
|
if (e?.wksid) {
|
|
|
console.log("e.wksid", e.wksid)
|
|
|
sid.value = e.wksid;
|
|
|
listenWs.value = true;
|
|
|
- let deviceid = localStorage.getItem("deviceid");
|
|
|
- startDevice({ deviceid: deviceid })
|
|
|
- timerManager.value.deviceid = setInterval(() => {
|
|
|
- if (device_info.value.handcontroller_id == undefined) {
|
|
|
- proxy?.$modal.msgWarning(`获取项目信息失败,正尝试重新获取,请稍等!`)
|
|
|
- startDevice({ deviceid: deviceid })
|
|
|
- } else {
|
|
|
- getClearTimer("deviceid");
|
|
|
- }
|
|
|
- }, 10000)
|
|
|
+ let deviceid = localStorage.getItem("deviceid") || '';
|
|
|
+ if (deviceid) {
|
|
|
+ startDevice({ deviceid: deviceid })
|
|
|
+ timerManager.value.deviceid = setInterval(() => {
|
|
|
+ if (device_info.value.handcontroller_id == undefined) {
|
|
|
+ //刷新
|
|
|
+ window.location.reload()
|
|
|
+ } else {
|
|
|
+ getClearTimer("deviceid");
|
|
|
+ }
|
|
|
+ }, 10000)
|
|
|
+ } else {
|
|
|
+ proxy?.$modal.msgError(`缺少设备信息请重新登录!`);
|
|
|
+ await proxy?.$http.common.logout({}).then((res: any) => {
|
|
|
+ });
|
|
|
+ proxy?.$modal?.closeLoading()
|
|
|
+ //清空缓存
|
|
|
+ localStorage.clear();
|
|
|
+ //跳转
|
|
|
+ router.push({ path: '/login/qrcode' });
|
|
|
+ }
|
|
|
}
|
|
|
if (listenWs.value == false) {
|
|
|
return false;
|