修改useDownloadBlob后端地址获取
parent
89495bcb39
commit
4eb96fd0df
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue