fix:【ai 大模型】模型返回异常时,空消息进行删除

pull/788/MERGE
YunaiV 2025-08-29 00:37:26 +08:00
parent da9c6799c8
commit 1ce97d57b7
1 changed files with 5 additions and 0 deletions

View File

@ -476,6 +476,10 @@ const doSendMessageStream = async (userMessage: ChatMessageVO) => {
const { code, data, msg } = JSON.parse(res.data) const { code, data, msg } = JSON.parse(res.data)
if (code !== 0) { if (code !== 0) {
message.alert(`对话异常! ${msg}`) message.alert(`对话异常! ${msg}`)
//
if (receiveMessageFullText.value === '') {
activeMessageList.value.pop()
}
return return
} }
@ -511,6 +515,7 @@ const doSendMessageStream = async (userMessage: ChatMessageVO) => {
await scrollToBottom() await scrollToBottom()
}, },
(error: any) => { (error: any) => {
//
message.alert(`对话异常! ${error}`) message.alert(`对话异常! ${error}`)
stopStream() stopStream()
// //