From b13194ca8b93271413e8d119c7703120a1efd239 Mon Sep 17 00:00:00 2001 From: Seven <1530011482@qq.com> Date: Wed, 16 Sep 2026 22:45:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/ChatPage.vue | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/pages/index/ChatPage.vue b/src/pages/index/ChatPage.vue index 3dcea2a..25e38a7 100644 --- a/src/pages/index/ChatPage.vue +++ b/src/pages/index/ChatPage.vue @@ -390,14 +390,12 @@ export default { } const newMessage = { - id: Date.now(), senderName: this.currentUser.username, receiverName: this.currentContact.contactName, content: content, - time: this.getCurrentTime(), }; - sendMessage() + sendMessage(newMessage) .then((response) => { console.log("发送消息成功", response.data); this.groupedMessages[this.currentContact.contactName].push({ @@ -418,16 +416,6 @@ export default { }); }, - // 获取当前时间 - getCurrentTime() { - const date = new Date(); - - const hours = String(date.getHours()).padStart(2, "0"); - const minutes = String(date.getMinutes()).padStart(2, "0"); - - return `${hours}:${minutes}`; - }, - // 滚动到底部 scrollToBottom() { const messageList = this.$refs.messageList;