From 24ead9f09bc28898d7115a58cb4b9256496df8b1 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Tue, 21 May 2024 16:21:14 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91AI=20?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=EF=BC=8C=E5=A4=84=E7=90=86id=20=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=EF=BC=8C=E5=AF=B9=E8=AF=9D=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai/chat/index.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/views/ai/chat/index.vue b/src/views/ai/chat/index.vue index 9a0e052a..c8e362fe 100644 --- a/src/views/ai/chat/index.vue +++ b/src/views/ai/chat/index.vue @@ -191,8 +191,11 @@ const textRoll = async () => { // ============ 处理对话滚动 ============== function scrollToBottom(isIgnore?: boolean) { + // isIgnore = isIgnore !== null ? isIgnore : false nextTick(() => { - messageRef.value.scrollToBottom(isIgnore) + if (messageRef.value) { + messageRef.value.scrollToBottom(isIgnore) + } }) } @@ -441,8 +444,10 @@ const getConversation = async (id: string | null) => { return } const conversation: ChatConversationVO = await ChatConversationApi.getChatConversationMy(id) - activeConversation.value = conversation - activeConversationId.value = conversation.id + if (conversation) { + activeConversation.value = conversation + activeConversationId.value = conversation.id + } } // ============ message ===========