From 88eddf4a58139c1d31c23ccb2b0f6b29adbfc1c9 Mon Sep 17 00:00:00 2001 From: satori Date: Wed, 15 Dec 2021 03:14:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BC=9A=E8=AF=9D=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E6=97=B6=E7=A7=BB=E9=99=A4=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fmhub.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fmhub.js b/fmhub.js index 6b7ade9..1f0ede6 100644 --- a/fmhub.js +++ b/fmhub.js @@ -30,6 +30,9 @@ export default class { if (user.size < 1) { console.log(`由于用户 ${uid} 已经没有会话, 直接移除此用户记录`) this.users.delete(uid) + this.channels.forEach((channel, fm) => { + channel.delete(uid) + }) } } 发送消息(fm, uid, data) { @@ -38,7 +41,7 @@ export default class { let channel = this.channels.get(fm) || new Map() if (!channel.size) this.channels.set(fm, channel) channel.forEach((value, userid) => { - console.log(userid, value) + //console.log(userid, value) let user = this.users.get(userid) || new Map() if (!user.size) { console.log(user)