From 942a6c795ee7b703ab7eb2dc3e4c6c4c9a9da88a Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期五, 14 二月 2025 15:20:02 +0800 Subject: [PATCH] historyId --- src/components/chat/hooks/useLoadData.ts | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/chat/hooks/useLoadData.ts b/src/components/chat/hooks/useLoadData.ts index 3c90982..5155f81 100644 --- a/src/components/chat/hooks/useLoadData.ts +++ b/src/components/chat/hooks/useLoadData.ts @@ -153,8 +153,8 @@ } as ChatMessage; }); const resList = await Promise.all( - (userMsg ?? []).map((item) => { - userItemIdMap.set(item.history_id, item); + (userMsg ?? []).map((item, index) => { + userItemIdMap.set(index, item); return getAnswerById(item.history_id); }) ); @@ -164,8 +164,8 @@ const currentUserMsg = tmpMessageList[insertIndex - 1]; currentUserMsg.content.values = item?.answer?.question ?? currentUserMsg.content.values; - const mapUser = userItemIdMap.get(item.answer?.history_id); - + const mapUser = userItemIdMap.get(index); + const historyId = mapUser?.history_id; const answerTime = formatShowTimeYear(mapUser?.create_time); //#region ====================== 閮藉悎骞跺埌绗竴涓紝鍚庨潰閮芥槸绌哄3瀛� ====================== const stepGroupList = (item?.answer?.reports ?? []).map((item) => ({ @@ -186,7 +186,7 @@ item.answer === null ? null : { - historyId: item.answer?.history_id, + historyId: historyId, role: RoleEnum.assistant, content: parseContent(item?.answer), state: item.answer_state, -- Gitblit v1.9.3