refactor(sse): 重构 SSE 分层并同步调整通知中心与示例页
- src/composables/sse: 删除,连接实现下沉到 utils/sse,事件名枚举迁到 enums/sse - src/utils/sse: 新增 SSE 连接与事件订阅实现 - src/stores/dict: 改用 utils/sse 订阅字典变更 - src/stores/user: 登出清理改用 utils/sse 的 cleanupSse - src/views/dashboard: 在线用户订阅下沉为页面级 composable - src/components/NoticeCenter: 由 NoticeDropdown 改名 - src/views/demo: 示例页面按 component/route/table 归类 - src/router: 同步示例详情页路由路径
This commit is contained in:
1 parent
d36ccf54d5
commit
d136266acd
47 files changed
+207
-430
No files matched your search
@@ -10,3 +10,4 @@ export * from "./business";
|
||||
export * from "./codegen";
|
||||
export * from "./common";
|
||||
export * from "./settings";
|
||||
export * from "./sse";
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* SSE 相关枚举
|
||||
*
|
||||
* @description
|
||||
* SSE 事件名枚举,与后端 SseTopics.java 一一对应
|
||||
*/
|
||||
|
||||
/**
|
||||
* SSE 事件名枚举
|
||||
*/
|
||||
export const enum SseTopics {
|
||||
/** 字典变更事件 */
|
||||
DICT = "dict",
|
||||
/** 在线用户数事件 */
|
||||
ONLINE_USERS = "online-users",
|
||||
/** 系统消息事件 */
|
||||
SYSTEM = "system",
|
||||
/** 心跳事件 */
|
||||
PING = "ping",
|
||||
/** 通知事件 */
|
||||
NOTICE = "notice",
|
||||
/** 通知撤回事件 */
|
||||
NOTICE_REVOKE = "notice-revoke",
|
||||
}
|
||||
Reference in new issue
Block a user