wuzhen update招生就业

This commit is contained in:
“wuzhen” committed 2026-04-02 10:49:59 +08:00
1 parent 7e122d76dd
commit e5c6fd7a24
55 files changed
+3563 -2397

No files matched your search

+10 -5
View File
@@ -248,17 +248,22 @@ service.interceptors.response.use(
return Promise.reject(error);
}
);
// 通用下载方法
export function download(url: string, params: any, fileName: string) {
// 通用下载方法(支持GET和POST)
export function download(url: string, params: any, fileName: string, method: string = 'post') {
downloadLoadingInstance = ElLoading.service({ text: '正在下载数据,请稍候', background: 'rgba(0, 0, 0, 0.7)' });
const isGet = method.toLowerCase() === 'get';
// prettier-ignore
return service.post(url, params, {
transformRequest: [
return service({
url: url,
method: method,
params: isGet ? params : undefined,
data: isGet ? undefined : params,
transformRequest: isGet ? undefined : [
(params: any) => {
return tansParams(params);
}
],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
headers: isGet ? undefined : { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
timeout: 1200000 // 导出接口单独设置20分钟超时
}).then(async (resp: any) => {