diff --git a/changelog.md b/changelog.md index f1f919a7e726c79a3c0d86d06d5d4af0e363350c..22f9202e46861095dc443db15b304f9ec2c25161 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +## 1.2.9(2023-07-10) +- 修复 因某次更新引起的:非流式响应模式下,未自动过滤历史消息中的涉敏内容,导致因上文涉敏而造成后续对话都涉敏的问题 [相关问题](https://ask.dcloud.net.cn/question/173701?notification_id-1286470__rf-false__item_id-246057#!answer_246057) ## 1.2.8(2023-07-07) - 优化 部分图标样式在,不同平台下,大小不一致的问题 ## 1.2.7(2023-07-03) diff --git a/package.json b/package.json index 07e9ca5aab4602bec6af570b42efd8731b33fb22..c4290ddb7dc92440757d67c4ec3d97e1c4ec266d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "id": "uni-ai-chat", "name": "uni-ai-chat", - "version": "1.2.8", + "version": "1.2.9", "description": "基于uni-ai的聊天示例项目,支持流式、支持前文总结,云端一体", "main": "main.js", "scripts": { diff --git a/pages/chat/chat.vue b/pages/chat/chat.vue index d7b074703d8e6d26a6cf27e8895720fb4b0b2a87..1ccebd169a552b915e470c7e0184f4461e584783 100644 --- a/pages/chat/chat.vue +++ b/pages/chat/chat.vue @@ -706,6 +706,15 @@ reply = "内容涉及敏感" } // 特殊处理 - end + + // 非流式模式 && 内容涉及敏感 + if (this.enableStream == false && illegal) { + console.error('内容涉及敏感'); + this.updateLastMsg({ + // 添加消息涉敏标记 + illegal: true + }) + } // 非流式模式 或者流式模式,但列表还没有数据且已经进入异常的情况下 if (this.enableStream == false || this.sseIndex == 0 && (illegal||insufficientScore)) { @@ -747,13 +756,7 @@ this.msgList.splice(index, 1, msg) // console.log('setSummarize this.msgList',this.msgList,this.msgList.length-1,index); } - if (illegal) { - console.error('内容涉及敏感'); - this.updateLastMsg({ - // 添加消息涉敏标记 - illegal: true - }) - } + }, complete:e=>{ if (this.enableStream) {