Commit 51762e54 authored by 水玉婷's avatar 水玉婷
Browse files

feat:修复思考模式无法渲染bug

parent 6c6b90e5
# 开发环境配置
VITE_API_BASE_URL=http://peddev.cmic.com.cn
# VITE_API_BASE_URL=http://peddev.cmic.com.cn
VITE_API_BASE_URL=http://10.17.86.60:8656
# 应用基础路径
VITE_BASE_PATH=/ai/
......
......@@ -3,8 +3,14 @@ import App from './App.vue'
import router from './router'
import { setRouter } from './utils/router-manager'
import { initGlobalErrorHandler, handle401Error, is401Error } from './utils/error-handler'
// 引入ant-design-vue
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
const app = createApp(App)
app.use(router)
app.use(Antd)
// 设置全局路由实例
setRouter(router)
......
......@@ -35,9 +35,10 @@
// 使用环境变量代替硬编码
const appCode = import.meta.env.VITE_APP_CODE || 'ped.qywx';
const time = new Date().getTime();
const chatParams = {
appId: '83b2664019a945d0a438abe6339758d8',
stage: 'wechat-demo',
stage: 'wechat-demo'+time,
};
// const dialogSessionId = '20251127180914709-00043912';
......
......@@ -415,21 +415,23 @@ export class ContentTemplateService {
updatedIsThinking = true;
// 记录思考开始时间
this.thinkingStartTime = Date.now();
if (updatedBlockIndex === -1 && updatedResponse) {
updatedBlockIndex = updatedResponse.contentBlocks.length;
updatedResponse.contentBlocks.push({
content: '',
thinkContent: `${messageContent}`,
hasThinkBox: true,
thinkBoxExpanded: false,
thinkingTime: 0,
thinkingTimeText: '正在思考中……',
});
} else if (updatedResponse && updatedResponse.contentBlocks[updatedBlockIndex]) {
updatedResponse.contentBlocks[updatedBlockIndex].thinkContent += ``;
updatedResponse.contentBlocks[updatedBlockIndex].hasThinkBox = true;
updatedResponse.contentBlocks[updatedBlockIndex].thinkBoxExpanded = defaultThinkBoxExpanded;
if (updatedResponse) {
// 如果blockIndex为-1或者当前索引对应的内容块不存在,创建新的思考内容块
if (updatedBlockIndex === -1 || !updatedResponse.contentBlocks[updatedBlockIndex]) {
updatedBlockIndex = updatedResponse.contentBlocks.length;
updatedResponse.contentBlocks.push({
content: '',
thinkContent: messageContent ? `${messageContent}` : '正在分析您的问题...',
hasThinkBox: true,
thinkBoxExpanded: false,
thinkingTime: 0,
thinkingTimeText: '正在思考中……',
});
} else {
// 如果已有思考内容块,确保hasThinkBox为true
updatedResponse.contentBlocks[updatedBlockIndex].hasThinkBox = true;
updatedResponse.contentBlocks[updatedBlockIndex].thinkBoxExpanded = defaultThinkBoxExpanded;
}
}
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment