初步实现消息通知功能

This commit is contained in:
Sunwuyuan
2025-11-23 14:19:09 +08:00
parent 76c2dba502
commit ca4de545b9
10 changed files with 2606 additions and 44 deletions
+8
View File
@@ -78,6 +78,14 @@ export function onConnect(handler) {
return () => s.off('connect', handler);
}
export function sendEvent(type, content = null) {
const s = getSocket();
s.emit('send-event', {
type,
content
});
}
export function disconnect() {
if (!socket) return;
try {