修改useDownloadBlob后端地址获取

master
LiuJiaNan 2025-10-29 17:59:44 +08:00
parent 89495bcb39
commit 4eb96fd0df
1 changed files with 1 additions and 3 deletions

View File

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