From d7e1aecb381f259b5bff2bf00b97ff709fed0b77 Mon Sep 17 00:00:00 2001 From: rd <1344903914@qq.com> Date: Fri, 5 Sep 2025 13:53:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=B7=E6=B1=82=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=85=B3=E9=97=ADsse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/querySSE.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/querySSE.ts b/src/utils/querySSE.ts index 1ea53d6..8097c5a 100644 --- a/src/utils/querySSE.ts +++ b/src/utils/querySSE.ts @@ -70,15 +70,14 @@ export default async (config: SSEConfig, url: string = DEFAULT_SSE_URL): Promise } }, onerror(error: Error) { - // console.error('SSE error:', error); + // 请求失败时主动关闭SSE连接 + abortController.abort(); handleError?.(error); }, onclose() { - // console.log('SSE connection closed'); handleClose?.(); }, async onopen(response: Response) { - // console.log('onopen', response); handleOpen?.(response); }, });