diff --git a/components/i/SearchHistory.vue b/components/i/SearchHistory.vue index a6c2c81b7b098962c4a499ea3c71c55478764610..665dcfdc3aa642f12cbe969081b8c8a449ffe53e 100644 --- a/components/i/SearchHistory.vue +++ b/components/i/SearchHistory.vue @@ -87,10 +87,10 @@ 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() +nextTick(() => { + getUserHistory() +}) diff --git a/pages/search/[id].vue b/pages/search/[id].vue index 6d1c2e9b127fa73d3867bd7df734f7cddc20d35e..8050769b36787bbe7cfcc8d51565f2daa62838c5 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