From b352221d2a2f4a8e8a1f9a12dda54fa32a8f7e4e Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期六, 22 六月 2024 14:44:46 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/utils/http.js | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/zy-asrs-flow/src/utils/http.js b/zy-asrs-flow/src/utils/http.js
index 904db20..fb9e654 100644
--- a/zy-asrs-flow/src/utils/http.js
+++ b/zy-asrs-flow/src/utils/http.js
@@ -43,6 +43,35 @@
return res;
}
+const doPostForm = async (url, params, fn) => {
+ const res = await request(url, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'multipart/form-data'
+ },
+ data: params
+ });
+ if (fn) {
+ fn(res);
+ }
+ return res;
+}
+
+const doPostBlob = async (url, params, fn) => {
+ const res = await request(url, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ data: { ...params },
+ responseType: 'blob'
+ });
+ if (fn) {
+ fn(res);
+ }
+ return res;
+}
+
const doPostPromise = (url, params, fn) => {
return request(url, {
method: 'POST',
@@ -63,6 +92,6 @@
});
}
-const Http = { doGet, doGetPromise, doPost, doPostPromise }
+const Http = { doGet, doGetPromise, doPost, doPostForm, doPostPromise, doPostBlob }
export default Http;
\ No newline at end of file
--
Gitblit v1.9.1