From df3da7edba9a7949b84017c050470aa682a1369c Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 1 Jan 2023 00:33:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=B0=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E6=88=90=E5=91=98=E4=B8=8D=E4=BC=9A=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=BE=A4=E7=BB=84=E5=88=97=E8=A1=A8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/services/core/group/group.service.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/services/core/group/group.service.ts b/server/services/core/group/group.service.ts index 28a2264d..8fa175a8 100644 --- a/server/services/core/group/group.service.ts +++ b/server/services/core/group/group.service.ts @@ -408,7 +408,7 @@ class GroupService extends TcService { const group: Group = await this.transformDocuments(ctx, {}, doc); - this.notifyGroupInfoUpdate(ctx, group); + this.notifyGroupInfoUpdate(ctx, group); // 推送变更 this.unicastNotify(ctx, userId, 'add', group); const textPanelIds = this.getGroupTextPanelIds(group); @@ -993,10 +993,14 @@ class GroupService extends TcService { group: Group ): Promise { const groupId = String(group._id); - const json = await this.transformDocuments(ctx, {}, group); + let json = group; + if (_.isPlainObject(group) === false) { + // 当传入的数据为group doc时 + json = await this.transformDocuments(ctx, {}, group); + } this.cleanGroupInfoCache(groupId); - this.roomcastNotify(ctx, groupId, 'updateInfo', json); + await this.roomcastNotify(ctx, groupId, 'updateInfo', json); return json; }