From e35403eaf44e67b20c78b1dc42172fac78ef1299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Tue, 2 Sep 2025 15:52:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(websocket):=20=E5=A4=84=E7=90=86=E8=A2=AB?= =?UTF-8?q?=E8=B8=A2=E5=87=BA=E9=80=9A=E7=9F=A5=E6=97=B6=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当收到"Kicked out"通知时,直接重定向到登录页面以强制用户重新登录 --- Cunkebao/src/store/module/websocket/msgManage.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cunkebao/src/store/module/websocket/msgManage.ts b/Cunkebao/src/store/module/websocket/msgManage.ts index 6845d5fc..fdcc0c1e 100644 --- a/Cunkebao/src/store/module/websocket/msgManage.ts +++ b/Cunkebao/src/store/module/websocket/msgManage.ts @@ -46,6 +46,10 @@ const messageHandlers: Record = { CmdNotify: message => { console.log("通知消息", message); // 在这里添加具体的处理逻辑 + if (message.notify == "Kicked out") { + // 被踢出时直接跳转到登录页面 + window.location.href = "/login"; + } }, // 可以继续添加更多处理器...