From c7524f699a5c60167d8ea3de94d6e5099824877f Mon Sep 17 00:00:00 2001 From: zhangjiming Date: Mon, 20 Jan 2025 20:33:21 +0800 Subject: [PATCH] =?UTF-8?q?socket=E6=96=AD=E5=BC=80=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=87=8D=E5=90=AF=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Index/Index.vue | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/pages/Index/Index.vue b/src/pages/Index/Index.vue index 67daf05..b9cd1ba 100644 --- a/src/pages/Index/Index.vue +++ b/src/pages/Index/Index.vue @@ -417,23 +417,24 @@ const onConfirmReport = async () => { const handleSocketClose = (num: number) => { if (num === 0) { - // 提示用户,连接断开,正尝试重新连接 + // socket连接断开 deviceWaitingModelInfo.value = { - title: '连接断开,正在尝试重新连接', - message: '请不要有任何手动操作!', + title: '系统产生错误,请重启系统', + message: '请尽快重启系统', } showDeviceWaitingModal.value = true - } else if (num === 5) { - // 重试达到最大次数,重试,取消。 - failMessage.value = { - title: '恢复连接失败', - message: '未能恢复连接,建议重启设备', - } - showFailModal.value = true } else if (num === -1) { // 从断开 到 恢复连接, 关闭弹框 showDeviceWaitingModal.value = false } + // else if (num === 5) { + // // 重试达到最大次数,重试,取消。 + // failMessage.value = { + // title: '恢复连接失败', + // message: '未能恢复连接,建议重启设备', + // } + // showFailModal.value = true + // } } // 处理应用事件消息 @@ -467,12 +468,7 @@ const onLogout = () => { const confirmFail = async () => { showFailModal.value = false - if (failMessage.value.title.match('连接失败')) { - wsEvent.connect() - wsState.connect() - } else { - await startInit() - } + await startInit() } //确认错误事件 const confirmError = async () => {