From b644543a565a64080941a0f01614ade07a4e09c1 Mon Sep 17 00:00:00 2001 From: ZRMYDYCG <547471919@qq.com> Date: Thu, 6 Mar 2025 13:52:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=EF=B8=8F=E8=81=94=E8=B0=83=20?= =?UTF-8?q?socket=20=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=E6=8E=A5=E5=8F=97?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/chat.ts | 7 +- src/view/chat/components/chat-content.vue | 160 ++++++++++++++-------- vite.config.ts | 2 +- 3 files changed, 104 insertions(+), 65 deletions(-) diff --git a/src/store/modules/chat.ts b/src/store/modules/chat.ts index e2288d2..49eabf1 100644 --- a/src/store/modules/chat.ts +++ b/src/store/modules/chat.ts @@ -1,11 +1,10 @@ -import type { IChatListVo } from '@/mock/types/chat/chat.vo.ts' import { defineStore } from 'pinia' import { computed, ref } from 'vue' const useChatStore = defineStore('chatStore', () => { // 聊天记录列表 - const chatList = ref([]) - const updateChatList = (list: IChatListVo[]) => { + const chatList = ref([]) + const updateChatList = (list: any[]) => { chatList.value = list } @@ -18,7 +17,7 @@ const useChatStore = defineStore('chatStore', () => { // 正在进行中的聊天 const activeChat = computed(() => { const index = chatList.value.findIndex((chat) => { - return chat.user_id === activeChatId.value + return chat.reciver_id === activeChatId.value }) if (index > -1) { diff --git a/src/view/chat/components/chat-content.vue b/src/view/chat/components/chat-content.vue index c5c1c4c..2e85500 100644 --- a/src/view/chat/components/chat-content.vue +++ b/src/view/chat/components/chat-content.vue @@ -4,7 +4,7 @@