From 69fe1b80c8995d112cde9e2fe6108354a605f9eb Mon Sep 17 00:00:00 2001 From: zoujing Date: Tue, 16 Sep 2025 20:54:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E8=B0=83=E8=B5=B7?= =?UTF-8?q?=E5=89=8D=E7=99=BB=E5=BD=95=E6=A3=80=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/chat/ChatMainList.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pages/chat/ChatMainList.vue b/pages/chat/ChatMainList.vue index 5818c94..d598929 100644 --- a/pages/chat/ChatMainList.vue +++ b/pages/chat/ChatMainList.vue @@ -287,6 +287,11 @@ const handleReply = (text) => { // 是发送指令 const handleReplyInstruct = (item) => { + if (!appStore.hasToken) { + console.log("没有token,跳转到登录页"); + goLogin(); + return; + } if (item.type === "MyOrder") { // 订单 uni.navigateTo({ @@ -480,11 +485,14 @@ const initWebSocket = () => { }); // 初始化连接 - webSocketManager.connect().then(() => { - webSocketConnectStatus = true; - }).catch((error) => { - console.error("WebSocket连接失败:", error); - }); + webSocketManager + .connect() + .then(() => { + webSocketConnectStatus = true; + }) + .catch((error) => { + console.error("WebSocket连接失败:", error); + }); }; // 处理WebSocket消息