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 |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/utils/request.js b/src/utils/request.js
index c6a596c..3e174b7 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -99,8 +99,8 @@
     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)
 }
@@ -111,10 +111,23 @@
     url: url,
     method: 'get',
     withCredentials: true,
-    timeout: 30000,
+    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',//鍏抽敭
-    headers: {'Content-Type': 'application/vnd.ms-excel',}//绫诲瀷淇敼涓篹xcel
+    responseType: 'blob' // 鍏抽敭
   }
   return request(false, query)
 }
@@ -127,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)
 }
@@ -137,5 +150,6 @@
   postWithOutLoadTip,
   get,
   form,
-  download
+  download,
+  downloadPost
 }

--
Gitblit v1.8.0