From 4f33e1e616e2a59112a6265073124abd7f0e81ed Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期二, 25 二月 2025 16:00:27 +0800 Subject: [PATCH] 修改地图 --- 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