refactor: SSE 连接增加 401/403 不重连、无 token 定时重试、流异常重连

This commit is contained in:
Ray.Hao
2026-07-30 18:43:45 +08:00
parent 1ff46bc33b
commit 4403380d49
8 changed files with 239 additions and 85 deletions

View File

@@ -0,0 +1,17 @@
/** SSE 事件名常量,与后端 SseTopics.java 一一对应 */
export const SseTopics = {
/** 字典变更事件 */
DICT: "dict",
/** 在线用户数事件 */
ONLINE_USERS: "online-users",
/** 系统消息事件 */
SYSTEM: "system",
/** 心跳事件 */
PING: "ping",
/** 通知事件 */
NOTICE: "notice",
/** 通知撤回事件 */
NOTICE_REVOKE: "notice-revoke",
} as const;
export type SseTopic = (typeof SseTopics)[keyof typeof SseTopics];