From e0da13d04b29fb191336cbb58f3594e8b457530b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 16 二月 2024 16:53:31 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/utils/http.js | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/zy-asrs-flow/src/utils/http.js b/zy-asrs-flow/src/utils/http.js
index 904db20..b18dbe4 100644
--- a/zy-asrs-flow/src/utils/http.js
+++ b/zy-asrs-flow/src/utils/http.js
@@ -43,6 +43,20 @@
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 doPostPromise = (url, params, fn) => {
return request(url, {
method: 'POST',
@@ -63,6 +77,6 @@
});
}
-const Http = { doGet, doGetPromise, doPost, doPostPromise }
+const Http = { doGet, doGetPromise, doPost, doPostForm, doPostPromise }
export default Http;
\ No newline at end of file
--
Gitblit v1.9.1