From 5ef1c5de988dfbcdd4335022ebad289049ead2e8 Mon Sep 17 00:00:00 2001 From: xlsea Date: Mon, 18 Aug 2025 15:24:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(hooks):=20=E4=BF=AE=E5=A4=8D=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=20hooks=20=E9=94=99=E8=AF=AF=E6=9C=AA=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/business/download.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks/business/download.ts b/src/hooks/business/download.ts index b3b70c14..357680d9 100644 --- a/src/hooks/business/download.ts +++ b/src/hooks/business/download.ts @@ -113,6 +113,10 @@ export function useDownload() { const response = await fetch(fullUrl, requestOptions); + if (response.status !== 200) { + throw new Error(errorCodeRecord.default); + } + await handleResponse(response); const rawHeader = response.headers.get('Download-Filename');