还原页面代码,添加导入逻辑

This commit is contained in:
dong.ai
2025-09-13 13:43:03 +08:00
parent 55ec13b36c
commit d8958d5d35
3 changed files with 28 additions and 21 deletions

View File

@@ -1,19 +1,15 @@
import http from "@/api/configSys";
import httpBase from "@/api/config";
/**
* @param {String} url [请求的url地址]
* @param {Object} params [参数]
* @param {String} fileName [导出文件名称] 默认值 导出文件
* @param {String} fileType [导出文件类型] 默认值 xls
* @param {string} mimeType [导出文件类型]
* @param {boolean} useSysApi [是否使用系统API] 默认值 true
*/
const useDownload = (url, params = {}, fileName = '导出文件', fileType = 'xls', mimeType = 'application/vnd.ms-excel;charset=UTF-8', useSysApi = true) => {
const request = useSysApi ? http : httpBase;
const useDownload = (url, params = {}, fileName = '导出文件', fileType = 'xls', mimeType = 'application/vnd.ms-excel;charset=UTF-8') => {
return new Promise((resolve, reject) => {
request.post(url, params, { responseType: 'blob' })
http.post(url, params, { responseType: 'blob' })
.then(res => {
resolve(res.data);
if (!res.data) {