From 9ba37ea876deb8f20b298c891617c4265d98d089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=98=89=E6=82=A6?= Date: Mon, 2 Jun 2025 17:40:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9C=AA=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=9A=84=E6=B6=88=E6=81=AF=E5=8F=91=E9=80=81bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/chat/layouts/chatWithId/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/chat/layouts/chatWithId/index.vue b/src/pages/chat/layouts/chatWithId/index.vue index 5c4f678..08fbe81 100644 --- a/src/pages/chat/layouts/chatWithId/index.vue +++ b/src/pages/chat/layouts/chatWithId/index.vue @@ -81,7 +81,7 @@ watch( function handleDataChunk(chunk: AnyObject) { try { // console.log('New chunk:', chunk); - const reasoningChunk = chunk.choices[0].delta.reasoning_content; + const reasoningChunk = chunk.choices?.[0].delta.reasoning_content; if (reasoningChunk) { // 开始思考链状态 bubbleItems.value[bubbleItems.value.length - 1].thinkingStatus = 'thinking'; @@ -91,7 +91,7 @@ function handleDataChunk(chunk: AnyObject) { } } - const parsedChunk = chunk.choices[0].delta.content; + const parsedChunk = chunk.choices?.[0].delta.content; if (parsedChunk) { // 结束 思考链状态 bubbleItems.value[bubbleItems.value.length - 1].thinkingStatus = 'end'; @@ -132,7 +132,7 @@ async function startSSE(chatContent: string) { role: item.role, content: item.content, })), - sessionId: String(route.params?.id), + sessionId: route.params?.id !== 'not_login' ? String(route.params?.id) : undefined, userId: userStore.userInfo?.userId, model: modelStore.currentModelInfo.modelName ?? '', });