From 89761212ad3ac02b68276d82c26ab6cd767ea216 Mon Sep 17 00:00:00 2001
From: zhangxiaoxu <819527061@qq.com>
Date: 星期二, 06 一月 2026 14:56:29 +0800
Subject: [PATCH] 新政修改密码功能

---
 utils/index.js |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/utils/index.js b/utils/index.js
index f87a629..73d0f11 100644
--- a/utils/index.js
+++ b/utils/index.js
@@ -8,8 +8,6 @@
 	},
 	headerPOST: {
 		"Content-type":'application/json'
-		// 'Content-Type': 'application/x-www-form-urlencoded',
-		
 	},
 }
 
@@ -21,17 +19,36 @@
 }
 
 // get璇锋眰
-export const reqGet = (url, params, opt = {}) => {
+// urlParam鏄嫾鎺ヨ矾寰勭殑鍙傛暟
+export const reqGet = (url, params, urlParam, opt = {}) => {
 	opt.header = typeObj['headerGET'];
 	opt.method = "GET";
 	opt.data = params;
-	return fetch(url, opt)
+	return fetch(url, opt ,urlParam)
 }
 
 // post璇锋眰
-export const reqPost = (url, params, opt = {}) => {
-	opt.header = typeObj['headerPOST'];
+export const reqPost = (url, params,form, opt = {}) => {
+	if(form == 'form'){
+		opt.header = {'Content-Type': 'application/x-www-form-urlencoded'}
+	} else {
+		opt.header = typeObj['headerPOST'];
+	}
 	opt.method = "POST";
 	opt.data = params;
+	opt.params = params;
 	return fetch(url, opt)
 }
+
+// put璇锋眰
+export const reqPut = (url, params,form, opt = {}) => {
+    if(form == 'form'){
+        opt.header = {'Content-Type': 'application/x-www-form-urlencoded'}
+    } else {
+        opt.header = typeObj['headerPOST'];
+    }
+    opt.method = "PUT";
+    opt.data = params;
+    opt.params = params;
+    return fetch(url, opt)
+}

--
Gitblit v1.9.1