Commit 49e5fc3e by YunaiV

fix:【AI 大模型】fetchEventSource 失败时,无限重试的问题

parent 47c2e742
...@@ -462,6 +462,8 @@ const doSendMessageStream = async (userMessage: ChatMessageVO) => { ...@@ -462,6 +462,8 @@ const doSendMessageStream = async (userMessage: ChatMessageVO) => {
(error) => { (error) => {
message.alert(`对话异常! ${error}`) message.alert(`对话异常! ${error}`)
stopStream() stopStream()
// 需要抛出异常,禁止重试
throw error
}, },
() => { () => {
stopStream() stopStream()
......
...@@ -80,6 +80,8 @@ const submit = (data: AiMindMapGenerateReqVO) => { ...@@ -80,6 +80,8 @@ const submit = (data: AiMindMapGenerateReqVO) => {
onError(err) { onError(err) {
console.error('生成思维导图失败', err) console.error('生成思维导图失败', err)
stopStream() stopStream()
// 需要抛出异常,禁止重试
throw error
}, },
ctrl: ctrl.value ctrl: ctrl.value
}) })
......
...@@ -57,9 +57,11 @@ const submit = (data: WriteVO) => { ...@@ -57,9 +57,11 @@ const submit = (data: WriteVO) => {
}, },
ctrl: abortController.value, ctrl: abortController.value,
onClose: stopStream, onClose: stopStream,
onError: (...err) => { onError: (error) => {
console.error('写作异常', ...err) console.error('写作异常', error)
stopStream() stopStream()
// 需要抛出异常,禁止重试
throw error
} }
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment