fix(hooks): 修复oss下载时未转码问题

This commit is contained in:
AN
2025-07-28 17:56:12 +08:00
parent e538355f2b
commit 2d31d7dc62

View File

@ -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'));