From 967105f3d03087cb77dcbafd67e525a8bda44a83 Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Tue, 11 Nov 2025 17:08:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9useDownloadBlob=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/SelectTree/HiddenLevel/Gwj/index.js | 2 +- hooks/useDownloadBlob/index.d.ts | 7 +------ hooks/useDownloadBlob/index.js | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/components/SelectTree/HiddenLevel/Gwj/index.js b/components/SelectTree/HiddenLevel/Gwj/index.js index 7aa8c29..0fa6812 100644 --- a/components/SelectTree/HiddenLevel/Gwj/index.js +++ b/components/SelectTree/HiddenLevel/Gwj/index.js @@ -63,7 +63,7 @@ function HiddenLevelSelectTree(props) { }, []); return ( - + ); } diff --git a/hooks/useDownloadBlob/index.d.ts b/hooks/useDownloadBlob/index.d.ts index 85e2a78..056ef8d 100644 --- a/hooks/useDownloadBlob/index.d.ts +++ b/hooks/useDownloadBlob/index.d.ts @@ -7,12 +7,7 @@ interface UseDownloadBlobOptions { params?: Record; } -export interface downloadBlobOptions { - url: string; - options?: UseDownloadBlobOptions; -} - -export type DownloadBlobFunction = (options: downloadBlobOptions) => Promise; +export type DownloadBlobFunction = (url: string, options: UseDownloadBlobOptions) => Promise; /** * 下载Blob流文件 diff --git a/hooks/useDownloadBlob/index.js b/hooks/useDownloadBlob/index.js index e66af53..4502c1e 100644 --- a/hooks/useDownloadBlob/index.js +++ b/hooks/useDownloadBlob/index.js @@ -18,7 +18,7 @@ export default function useDownloadBlob(returnType = "object") { return reject(new Error("请传入 url")); const { name = "", type = "", params = {} } = options; - const finalUrl = (process.env.app.API_HOST || window.__JJB_ENVIRONMENT__.API_HOST) + url; + const finalUrl = new URL((process.env.app.API_HOST || window.__JJB_ENVIRONMENT__.API_HOST) + url); Object.entries(params).forEach(([key, value]) => { finalUrl.searchParams.append(key, value); });