fix(websocket): 处理被踢出通知时跳转到登录页面

当收到"Kicked out"通知时,直接重定向到登录页面以强制用户重新登录
This commit is contained in:
超级老白兔
2025-09-02 15:52:44 +08:00
parent 8d8068f5d6
commit e35403eaf4

View File

@@ -46,6 +46,10 @@ const messageHandlers: Record<string, MessageHandler> = {
CmdNotify: message => {
console.log("通知消息", message);
// 在这里添加具体的处理逻辑
if (message.notify == "Kicked out") {
// 被踢出时直接跳转到登录页面
window.location.href = "/login";
}
},
// 可以继续添加更多处理器...