From 64469e1310ec1563267260bb105738a1aa702bc0 Mon Sep 17 00:00:00 2001 From: DCloud__JSON Date: Fri, 9 Jun 2023 23:40:41 +0800 Subject: [PATCH] 1.1.1 --- changelog.md | 2 ++ components/uni-ai-msg/uni-ai-msg.vue | 9 +++++++-- package.json | 2 +- pages/chat/chat.vue | 19 +++++++++++++------ 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/changelog.md b/changelog.md index b55259b..df6e2f6 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +## 1.1.1(2023-06-09) +- 修复 web-pc端样式错误 ## 1.1.0(2023-06-09) - 【重要】优化`uni-ai-chat`云对象的`send`方法性能(并发:“普通消息对话”和“获得内容总结”),大幅提高会话响应速度。 - 修复 手机端 当消息列表数据不满一屏幕时,键盘弹出后看不到历史消息 diff --git a/components/uni-ai-msg/uni-ai-msg.vue b/components/uni-ai-msg/uni-ai-msg.vue index db07692..3556426 100644 --- a/components/uni-ai-msg/uni-ai-msg.vue +++ b/components/uni-ai-msg/uni-ai-msg.vue @@ -176,8 +176,13 @@ let htmlString = '' // 修改转换结果的htmlString值 用于正确给界面增加鼠标闪烁的效果 // 判断markdown中代码块标识符的数量是否为偶数 - if (this.msgContent.split("```").length % 2) { - htmlString = markdownIt.render(this.msgContent)+ '|'; + if (this.msgContent.split("```").length % 2) { + let msgContent = this.msgContent + if(msgContent[msgContent.length-1] != '\n'){ + msgContent += '\n' + } + msgContent += ' |' + htmlString = markdownIt.render(msgContent); } else { htmlString = markdownIt.render(this.msgContent) + ' \n |'; } diff --git a/package.json b/package.json index b6a8751..591bebd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "id": "uni-ai-chat", "name": "uni-ai-chat", - "version": "1.1.0", + "version": "1.1.1", "description": "基于uni-ai的聊天示例项目,支持流式、支持前文总结,云端一体", "main": "main.js", "scripts": { diff --git a/pages/chat/chat.vue b/pages/chat/chat.vue index 511f5e7..8ccf787 100644 --- a/pages/chat/chat.vue +++ b/pages/chat/chat.vue @@ -552,7 +552,7 @@ let messages = [] // 复制一份,消息列表数据 - let msgs = msgList.filter(i => i.isDelete !== true) + let msgs = Array.from(msgList).filter(i => i.isDelete !== true) // 带总结的消息 index let findIndex = [...msgs].reverse().findIndex(item => item.summarize) // console.log('findIndex', findIndex) @@ -795,7 +795,8 @@ @import "@/components/uni-ai-msg/uni-ai-msg.scss"; /* #endif */ - /* #ifndef APP-NVUE */ + /* #ifndef APP-NVUE */ + page, .container *, view, textarea, @@ -960,15 +961,21 @@ border-top: solid 1px #dde0e2; } - .container * { + .container,.container * { max-width: 950px; } .container { - box-shadow: 0 0 5px #e0e1e7; - margin-top: 44px; + box-shadow: 0 0 5px #e0e1e7; + height: calc(100vh - 44px); + margin: 22px auto; border-radius: 10px; - overflow: hidden; + overflow: hidden; + background-color: #FAFAFA; + } + + page { + background-color: #efefef; } .container .header { -- GitLab