Skip to content

Commit 1ce97d5

Browse files
committed
fix:【ai 大模型】模型返回异常时,空消息进行删除
1 parent da9c679 commit 1ce97d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/views/ai/chat/index/index.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ const doSendMessageStream = async (userMessage: ChatMessageVO) => {
476476
const { code, data, msg } = JSON.parse(res.data)
477477
if (code !== 0) {
478478
message.alert(`对话异常! ${msg}`)
479+
// 如果未接收到消息,则进行删除
480+
if (receiveMessageFullText.value === '') {
481+
activeMessageList.value.pop()
482+
}
479483
return
480484
}
481485
@@ -511,6 +515,7 @@ const doSendMessageStream = async (userMessage: ChatMessageVO) => {
511515
await scrollToBottom()
512516
},
513517
(error: any) => {
518+
// 异常提示,并停止流
514519
message.alert(`对话异常! ${error}`)
515520
stopStream()
516521
// 需要抛出异常,禁止重试

0 commit comments

Comments
 (0)