From c2048b7cada69d1dba3b02d37e9fa2debd3cb44d Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Mon, 27 May 2024 11:14:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/i/SearchHistory.vue | 12 +++++++----- pages/search/[id].vue | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/components/i/SearchHistory.vue b/components/i/SearchHistory.vue index a6c2c81..fb77ba3 100644 --- a/components/i/SearchHistory.vue +++ b/components/i/SearchHistory.vue @@ -87,10 +87,12 @@ function handleClickItem () { Layout.handleCloseAside() } async function getUserHistory () { - const { data, error } = await useRequest('/v1/chat/completion/list', { server: false }) - if (!error.value) { - searchHistory.value = data.value && data.value.data || [] - } + const { data } = await useRequest('/v1/chat/completion/list') + searchHistory.value = data.value && data.value.data || [] } -getUserHistory() +onMounted(() => { + nextTick(() => { + getUserHistory() + }) +}) diff --git a/pages/search/[id].vue b/pages/search/[id].vue index 6d1c2e9..8050769 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -202,8 +202,8 @@ const handleMessage = (event) => { handleFormFetchData(event.data) } const handleStopGenerate = () => { - asking.value && aiChatController && aiChatController.abort() asking.value = false + aiChatController && aiChatController.abort() Object.assign(askingData.value, { ansLoading: false, desLoading: false, @@ -211,8 +211,10 @@ const handleStopGenerate = () => { }) } const handleError = (event) => { - console.log(222) handleStopGenerate() + if (event) { + throw event; + } } const fetchLinkedQuestion = (query) => { const { gitPath, id } = state -- GitLab