From fe83940be085359cc80129e413be63f380e29dda Mon Sep 17 00:00:00 2001 From: xsx <825657193@qq.com> Date: Sat, 27 Sep 2025 15:03:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B6=88=E6=81=AF=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=B8=80=E7=9B=B4=E5=8F=91=E9=80=81=E4=B8=AD=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-uniapp/store/chatStore.js | 8 ++++++++ im-web/src/store/chatStore.js | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/im-uniapp/store/chatStore.js b/im-uniapp/store/chatStore.js index 16d3419..91dc0a1 100644 --- a/im-uniapp/store/chatStore.js +++ b/im-uniapp/store/chatStore.js @@ -523,6 +523,14 @@ export default defineStore('chatStore', { if (msgInfo.tmpId) { for (let idx = chat.messages.length - 1; idx >= 0; idx--) { let m = chat.messages[idx]; + // 这里只查询临时消息,跳过正常消息 + if (m.id) { + continue; + } + // 这里只查询临时消息,跳过有id的正常消息 + if (m.id) { + contine; + } if (m.tmpId && msgInfo.tmpId == m.tmpId) { return m; } diff --git a/im-web/src/store/chatStore.js b/im-web/src/store/chatStore.js index 046d842..f4b6bc7 100644 --- a/im-web/src/store/chatStore.js +++ b/im-web/src/store/chatStore.js @@ -551,6 +551,10 @@ export default defineStore('chatStore', { if (msgInfo.tmpId) { for (let idx = chat.messages.length - 1; idx >= 0; idx--) { let m = chat.messages[idx]; + // 这里只查询临时消息,跳过正常消息 + if (m.id) { + continue; + } if (m.tmpId && msgInfo.tmpId == m.tmpId) { return m; }