From 790f84dd6e70fc8a0c94bea2ba0761729d45061a Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期三, 13 一月 2021 11:46:43 +0800
Subject: [PATCH] 添加delUser

---
 userApi.go |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/userApi.go b/userApi.go
index 104783d..84ce7e0 100644
--- a/userApi.go
+++ b/userApi.go
@@ -87,4 +87,40 @@
 		return false,nil
 	}
 	return res.Success,res.Data
+}
+
+func (api UserApi) UpdatePwd(userId string, oldPwd string, newPwd string) (bool,interface{}) {
+	url := api.getBasicUrl() + DATA_URL_PREFIX + "/user/updatePwd"
+	client := NewClient()
+	paramBody := map[string]interface{}{
+		"userId": userId,
+		"oldPwd": oldPwd,
+		"newPwd": newPwd,
+	}
+	respBody, err := client.DoPostRequest(url, CONTENT_TYPE_FORM, paramBody,nil, nil)
+	if err != nil {
+		return false,nil
+	}
+	var res Result
+	if err = json.Unmarshal(respBody, &res); err != nil {
+		return false,nil
+	}
+	return res.Success,res.Data
+}
+
+func (api UserApi) DelUser(ids []string) (bool,interface{}) {
+	url := api.getBasicUrl() + DATA_URL_PREFIX + "/user/delUser"
+	client := NewClient()
+	paramBody := map[string]interface{}{
+		"ids": ids,
+	}
+	respBody, err := client.DoPostRequest(url, CONTENT_TYPE_FORM, paramBody,nil, nil)
+	if err != nil {
+		return false,nil
+	}
+	var res Result
+	if err = json.Unmarshal(respBody, &res); err != nil {
+		return false,nil
+	}
+	return res.Success,res.Data
 }
\ No newline at end of file

--
Gitblit v1.8.0