fix(hooks): 修复下载 hooks 错误未处理

This commit is contained in:
xlsea
2025-08-18 15:24:25 +08:00
parent 90a14e338a
commit 5ef1c5de98

View File

@ -113,6 +113,10 @@ export function useDownload() {
const response = await fetch(fullUrl, requestOptions); const response = await fetch(fullUrl, requestOptions);
if (response.status !== 200) {
throw new Error(errorCodeRecord.default);
}
await handleResponse(response); await handleResponse(response);
const rawHeader = response.headers.get('Download-Filename'); const rawHeader = response.headers.get('Download-Filename');