From fa906225a7c99adf25ffc84030e7432494407976 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Tue, 23 May 2023 15:02:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E4=BC=9A=E8=AF=9D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/display/newChat/chatDialog.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/views/newMap/display/newChat/chatDialog.vue b/src/views/newMap/display/newChat/chatDialog.vue index b7a2a4658..9447c64a0 100644 --- a/src/views/newMap/display/newChat/chatDialog.vue +++ b/src/views/newMap/display/newChat/chatDialog.vue @@ -615,9 +615,9 @@ export default { let name = ''; if (item.type == 'PRIVATE_CHAT') { let mId = ''; - if (item.memberList[0].memberId == this.myMemberId) { + if (item.memberList[0].memberId == this.myMemberId && item.memberList[1]) { mId = item.memberList[1].memberId; - } else if (item.memberList[1].memberId == this.myMemberId) { + } else { mId = item.memberList[0].memberId; } const node = this.memberData[mId]; @@ -731,12 +731,11 @@ export default { }, getPrivateChatId(item) { let pId = ''; - if (item.type == 'PRIVATE_CHAT' && (item.memberList[0].memberId == this.myMemberId || item.memberList[1].memberId == this.myMemberId)) { - const find = item.memberList.find(ii => { - return ii.memberId != this.myMemberId; - }); - if (find) { - pId = find.memberId; + if (item.type == 'PRIVATE_CHAT') { + if (item.memberList[0].memberId == this.myMemberId && item.memberList[1]) { + pId = item.memberList[1].memberId; + } else { + pId = item.memberList[0].memberId; } } return pId;