mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-20 00:06:47 +08:00
还原页面代码,添加导入逻辑
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user