diff --git a/hooks/useDownloadBlob/index.js b/hooks/useDownloadBlob/index.js index fd7c659..c1b0232 100644 --- a/hooks/useDownloadBlob/index.js +++ b/hooks/useDownloadBlob/index.js @@ -1,7 +1,6 @@ import { message } from "antd"; import dayjs from "dayjs"; import { useState } from "react"; -import { getFileUrl } from "../../utils/index.js"; /** * 下载Blob流文件 @@ -13,9 +12,8 @@ export default function useDownloadBlob() { // 下载Blob流文件 const downloadBlob = (url, options = { name: "", type: "", params: {} }) => { setLoading(true); - const fileUrl = getFileUrl(); return new Promise((resolve, reject) => { - const finalUrl = !url.includes(fileUrl) ? fileUrl + url : url; + const finalUrl = (process.env.app.API_HOST || window.__JJB_ENVIRONMENT__.API_HOST) + url; Object.entries(options.params).forEach(([key, value]) => { finalUrl.searchParams.append(key, value); });