Commit 87299d8a authored by 水玉婷's avatar 水玉婷
Browse files

feat:细节优化

parent 2dcda17f
......@@ -48,11 +48,11 @@ export default {
onMounted(() => {
// 检查是否已登录
// const status = wechat.checkLoginStatus()
// if (status.isLoggedIn) {
// router.replace('/')
// return
// }
const status = wechat.checkLoginStatus()
if (status.isLoggedIn) {
router.replace('/')
return
}
// 执行静默登录
handleLogin()
......
......@@ -44,8 +44,6 @@ body {
padding: 0;
margin: 0;
box-sizing: border-box;
// 跨浏览器滚动条隐藏方案
// Webkit浏览器滚动条样式(Chrome, Safari, Edge)
&::-webkit-scrollbar {
......
......@@ -293,33 +293,6 @@ export class ContentTemplateService {
case 3: // 图表数据
if (updatedResponse) {
switch (contentType) {
case 0: // 普通文本内容
// 检查最后一个块是否是普通文本块,如果是则合并,否则创建新块
const isLastText = isLastBlockText(updatedResponse.contentBlocks);
if (isLastText) {
// 合并到现有的普通文本块
const lastTextIndex = getLastTextBlockIndex(updatedResponse.contentBlocks);
if (lastTextIndex !== -1) {
updatedResponse.contentBlocks[lastTextIndex].content =
mergeTextContent(
updatedResponse.contentBlocks[lastTextIndex].content,
messageContent
);
}
} else {
// 创建新的内容块
updatedBlockIndex = updatedResponse.contentBlocks.length;
updatedResponse.contentBlocks.push({
content: this.templates.text(messageContent),
hasThinkBox: false,
thinkContent: '',
thinkBoxExpanded: false,
});
}
break;
case 2:
// 图表数据处理
updatedResponse.contentBlocks.push({
......@@ -416,6 +389,14 @@ export class ContentTemplateService {
updatedResponse.showRecommendations = true;
}
break;
default: // 默认处理
updatedResponse.contentBlocks.push({
content: this.templates.text(messageContent || ''),
hasThinkBox: false,
thinkContent: '',
thinkBoxExpanded: false,
});
break;
}
}
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