diff --git a/www/app.js b/www/app.js index f3bc6e3..b3d3cea 100644 --- a/www/app.js +++ b/www/app.js @@ -1165,9 +1165,10 @@ function renderMessages() { // 思考内容块(仅AI消息) let thinkingHtml = ''; - if (!isUser && msg.thinking) { - // 判断是否是当前正在生成的消息(有thinking且content为空或很短) + if (!isUser && 'thinking' in msg) { + // 判断是否是当前正在生成的消息(有thinking字段且正在加载) const isGenerating = index === currentConversation.messages.length - 1 && isLoading && enableThinking; + // 思考进行中且没有正式内容时展开 const expandedClass = isGenerating && !msg.content ? 'expanded' : ''; thinkingHtml = ` @@ -1177,7 +1178,7 @@ function renderMessages() { 思考过程 -
${renderMarkdown(msg.thinking)}
+
${renderMarkdown(msg.thinking || '思考中...')}
`; } diff --git a/www/index.html b/www/index.html index da7e1ed..49ccc13 100644 --- a/www/index.html +++ b/www/index.html @@ -8,12 +8,12 @@ AI助手 - +
- - + + \ No newline at end of file