From 8d385a8ddb16e0f7faf6e6de2fc438a2e34f32f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=AE=85=E7=94=B7=28YznCMS=E5=AE=98=E6=96=B9=29?= <530765310@qq.com> Date: Wed, 5 Feb 2025 15:01:05 +0800 Subject: [PATCH 1/2] Update contacts.ts --- src/stores/contacts.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/stores/contacts.ts b/src/stores/contacts.ts index 0a8dc96..c94ed9c 100644 --- a/src/stores/contacts.ts +++ b/src/stores/contacts.ts @@ -4,9 +4,11 @@ import apis from '@/services/apis' import { useGlobalStore } from '@/stores/global' import type { ContactItem, RequestFriendItem } from '@/services/types' import { RequestFriendAgreeStatus } from '@/services/types' +import { useChatStore } from './chat' export const pageSize = 20 export const useContactStore = defineStore('contact', () => { + const chatStore = useChatStore() const globalStore = useGlobalStore() const contactsList = reactive([]) const requestFriendsList = reactive([]) @@ -103,6 +105,10 @@ export const useContactStore = defineStore('contact', () => { // getRequestFriendsList(true) // 刷新好友列表 getContactList(true) + // 更新会话列表 + chatStore.removeContact(data.roomId) + // 切换为第一个会话 + globalStore.currentSession.roomId = chatStore.sessionList[0].roomId } return { getContactList, From e4888df9242eec964a0fc158627524a6cef95116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E5=AE=85=E7=94=B7=28YznCMS=E5=AE=98=E6=96=B9=29?= <530765310@qq.com> Date: Wed, 5 Feb 2025 16:14:24 +0800 Subject: [PATCH 2/2] Update contacts.ts --- src/stores/contacts.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stores/contacts.ts b/src/stores/contacts.ts index c94ed9c..153f28e 100644 --- a/src/stores/contacts.ts +++ b/src/stores/contacts.ts @@ -109,6 +109,7 @@ export const useContactStore = defineStore('contact', () => { chatStore.removeContact(data.roomId) // 切换为第一个会话 globalStore.currentSession.roomId = chatStore.sessionList[0].roomId + globalStore.currentSession.type = chatStore.sessionList[0].type } return { getContactList,