diff --git a/ui/src/views/chat/embed/index.vue b/ui/src/views/chat/embed/index.vue index 7e67c446f..e644f9937 100644 --- a/ui/src/views/chat/embed/index.vue +++ b/ui/src/views/chat/embed/index.vue @@ -201,6 +201,13 @@ function getChatLog(id: string) { log.asyncGetChatLogClient(id, page, left_loading).then((res: any) => { chatLogData.value = res.data.records + paginationConfig.current_page = 1 + paginationConfig.total = 0 + currentRecordList.value = [] + currentChatId.value = chatLogData.value?.[0]?.id || 'new' + if (currentChatId.value !== 'new') { + getChatRecord() + } }) } diff --git a/ui/src/views/chat/pc/index.vue b/ui/src/views/chat/pc/index.vue index cdeefbc39..ba4338ed1 100644 --- a/ui/src/views/chat/pc/index.vue +++ b/ui/src/views/chat/pc/index.vue @@ -270,7 +270,16 @@ function getChatLog(id: string, refresh?: boolean) { log.asyncGetChatLogClient(id, page, left_loading).then((res: any) => { chatLogData.value = res.data.records if (refresh) { - currentChatName.value = chatLogData.value?.[0].abstract + currentChatName.value = chatLogData.value?.[0]?.abstract + } else { + paginationConfig.value.current_page = 1 + paginationConfig.value.total = 0 + currentRecordList.value = [] + currentChatId.value = chatLogData.value?.[0]?.id || 'new' + currentChatName.value = chatLogData.value?.[0]?.abstract || t('chat.createChat') + if (currentChatId.value !== 'new') { + getChatRecord() + } } }) }