From 66c256cefd12809b592964fc0d99dc8c77fa5897 Mon Sep 17 00:00:00 2001 From: zoujing Date: Mon, 15 Sep 2025 20:00:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E7=94=9F=E6=88=90=E7=9A=84=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E6=B6=88=E6=81=AFid=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/chat/ChatMainList.vue | 2 +- utils/index.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pages/chat/ChatMainList.vue b/pages/chat/ChatMainList.vue index fab47cf..d0963c2 100644 --- a/pages/chat/ChatMainList.vue +++ b/pages/chat/ChatMainList.vue @@ -358,7 +358,7 @@ const initHandler = () => { console.log("initHandler"); loadRecentConversation(); - loadConversationMsgList(); + ///loadConversationMsgList(); initWebSocket(); }; diff --git a/utils/index.js b/utils/index.js index 046c3c7..c3645ed 100644 --- a/utils/index.js +++ b/utils/index.js @@ -13,7 +13,12 @@ export class IdUtils { * @returns {string} 消息ID */ static generateMessageId() { - return "mid" + new Date().getTime(); + const timestamp = new Date().getTime(); + const chars = "abcdefghijklmnopqrstuvwxyz"; + const randomStr = Array.from({ length: 4 }, () => + chars.charAt(Math.floor(Math.random() * chars.length)) + ).join(""); + return "mid"+ randomStr + timestamp; } }