From 80746d20fd7f39f5b12e2079e2d60ad11699b1a4 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Thu, 16 May 2024 23:49:03 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E5=A2=9E=E5=8A=A0=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/Conversation.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/ai/chat/Conversation.vue b/src/views/ai/chat/Conversation.vue index a75f12c4..ba69f357 100644 --- a/src/views/ai/chat/Conversation.vue +++ b/src/views/ai/chat/Conversation.vue @@ -128,14 +128,20 @@ const handleConversationClick = async (id: string) => { */ const getChatConversationList = async () => { // 1、获取 对话数据 - conversationList.value = await ChatConversationApi.getChatConversationMyList() - // 2、没有 任何对话情况 + const res = await ChatConversationApi.getChatConversationMyList() + // 2、排序 + res.sort((a, b) => { + console.log('sort', a, b) + return b.updateTime - a.updateTime + }) + conversationList.value = res + // 3、没有 任何对话情况 if (conversationList.value.length === 0) { activeConversationId.value = null conversationMap.value = {} return } - // 3、对话根据时间分组(置顶、今天、一天前、三天前、七天前、30天前) + // 4、对话根据时间分组(置顶、今天、一天前、三天前、七天前、30天前) conversationMap.value = await conversationTimeGroup(conversationList.value) }