From 6f17f9875439efa6744b3a124ddb729868644b92 Mon Sep 17 00:00:00 2001 From: ulleo Date: Wed, 4 Feb 2026 11:27:45 +0800 Subject: [PATCH] chore: add frontend console log --- frontend/src/views/chat/index.vue | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue index 3c791d6e..97493d68 100644 --- a/frontend/src/views/chat/index.vue +++ b/frontend/src/views/chat/index.vue @@ -934,18 +934,23 @@ async function clickAnalysis(id?: number) { } function getRecordUsage(recordId: any) { - chatApi.get_chart_usage(recordId).then((res) => { - const logHistory = chatApi.toChatLogHistory(res) - if (logHistory) { - currentChat.value.records.forEach((record) => { - if (record.id === recordId) { - record.duration = logHistory.duration - record.finish_time = logHistory.finish_time - record.total_tokens = logHistory.total_tokens - } - }) - } - }) + chatApi + .get_chart_usage(recordId) + .then((res) => { + const logHistory = chatApi.toChatLogHistory(res) + if (logHistory) { + currentChat.value.records.forEach((record) => { + if (record.id === recordId) { + record.duration = logHistory.duration + record.finish_time = logHistory.finish_time + record.total_tokens = logHistory.total_tokens + } + }) + } + }) + .catch((e) => { + console.error(e) + }) } const predictAnswerRef = ref()