Commit 67a904c3 by Liu

fix: 历史会话记录增加toolID

parent bc0509b3
......@@ -8,7 +8,7 @@ import type { RootState } from '@/store'
import SendIcon from '@/assets/svg/send.svg?react'
import { type WithAuthProps, withAuth } from '@/auth/withAuth'
import { useAppDispatch, useAppSelector } from '@/store/hook'
import { clearBusinessInsightWorkflow, clearCurrentToolId, setCurrentToolId } from '@/store/conversationSlice'
import { clearBusinessInsightWorkflow, clearCurrentToolId, fetchConversations, setCurrentToolId } from '@/store/conversationSlice'
import { setIsAsking } from '@/store/chatSlice'
import { fetchToolList } from '@/api/home'
import { safeSessionStorageGetItem, safeSessionStorageRemoveItem, safeSessionStorageSetItem } from '@/lib/utils'
......@@ -434,6 +434,7 @@ const ChatEditorBase: React.FC<ChatEditorProps & WithAuthProps> = ({ checkAuth,
}
}
}
dispatch(fetchConversations(normalizedToolId))
sessionStorage.removeItem('toolHistoryLoading')
}
}
......
......@@ -25,14 +25,17 @@ const initialState: ConversationState = {
export const fetchConversations = createAsyncThunk(
'conversation/fetchConversations',
async (_, { rejectWithValue }) => {
async (toolId?: string, { rejectWithValue }) => {
try {
await waitForToken()
// 调用真实接口获取会话列表
const response = await fetchQueryUserConversationPage({
const requestData: Record<string, any> = {
pageNum: 1,
pageSize: 100,
})
}
if (toolId) {
requestData.toolId = toolId
}
const response = await fetchQueryUserConversationPage(requestData)
const records = response.data?.records || []
return processConversationData(records)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment