From 2d31d7dc62867ef9f8345730840ea61a5b6e1055 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Mon, 28 Jul 2025 17:56:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(hooks):=20=E4=BF=AE=E5=A4=8Doss=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=97=B6=E6=9C=AA=E8=BD=AC=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/business/download.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/business/download.ts b/src/hooks/business/download.ts index 866aa78a..b3b70c14 100644 --- a/src/hooks/business/download.ts +++ b/src/hooks/business/download.ts @@ -115,7 +115,8 @@ export function useDownload() { await handleResponse(response); - const finalFilename = filename || response.headers.get('Download-Filename') || `download-${timestamp}`; + const rawHeader = response.headers.get('Download-Filename'); + const finalFilename = filename || (rawHeader ? decodeURIComponent(rawHeader) : null) || `download-${timestamp}`; if (response.body && isHttps()) { const contentLength = Number(response.headers.get('Content-Length'));