From 2bddfa78e65f351d6cb81f670775e79620f684a6 Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期五, 24 五月 2024 10:43:51 +0800 Subject: [PATCH] feat:分数统计 --- src/utils/request.js | 37 +++++++++++++++++++++++++++++++++---- 1 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 43763a6..3e174b7 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -99,11 +99,39 @@ withCredentials: true, timeout: 30000, data: params, - responseType: 'blob',//鍏抽敭 - headers: {'Content-Type': 'application/vnd.ms-excel',}//绫诲瀷淇敼涓篹xcel + responseType: 'blob', // 鍏抽敭 + headers: { 'Content-Type': 'application/vnd.ms-excel' }// 绫诲瀷淇敼涓篹xcel } return request(false, query) } + +const download = function (url, params) { + const query = { + baseURL: process.env.VUE_APP_URL, + url: url, + method: 'get', + withCredentials: true, + timeout: 300000, + params: params, + responseType: 'blob', // 鍏抽敭 + headers: { 'Content-Type': 'application/vnd.ms-excel' }// 绫诲瀷淇敼涓篹xcel + } + return request(false, query) +} + +const downloadPost = function (url, params) { + const query = { + baseURL: process.env.VUE_APP_URL, + url: url, + method: 'post', + withCredentials: true, + timeout: 300000, + data: params, + responseType: 'blob' // 鍏抽敭 + } + return request(false, query) +} + export const down = function (url, params) { const query = { baseURL: process.env.VUE_APP_URL, @@ -112,7 +140,7 @@ withCredentials: true, timeout: 30000, data: params, - headers: { responseType: 'blob', 'Content-Type': 'multipart/form-data', 'request-ajax': true} + headers: { responseType: 'blob', 'Content-Type': 'multipart/form-data', 'request-ajax': true } } return request(false, query) } @@ -122,5 +150,6 @@ postWithOutLoadTip, get, form, - + download, + downloadPost } -- Gitblit v1.8.0