fix(chat): constrain auth state transitions

This commit is contained in:
2026-06-23 14:10:59 +08:00
parent ebd44c4980
commit 7dd4878d7d
2 changed files with 7 additions and 14 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
* - `ChatGuestLogin`:游客进入 /chat —— 拉本地消息 + 初始化配额(不连 WS)
* - `ChatNonVipLogin`:非 VIP 用户进入 /chat —— 拉服务器端首屏,不连 WS
* - `ChatVipLogin`VIP 用户进入 /chat —— 拉服务器端首屏 + 连 WStoken 在 payload
* - `ChatLogout`:登出 / 切换用户 —— 断 WS + 清消息
* - `ChatLogout`正式登录用户登出 —— 断 WS + 清消息
*
* 设计:所有WS / 历史 / 配额相关副作用全部通过派发事件给 chat 机器处理,
* chat-screen 不直接创建 ChatWebSocket / 不读 AuthStorage(除 token 取值)。