From 4d14183d92283a0edf77ef20d6dfab9bc0da56f9 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期二, 30 七月 2019 13:53:48 +0800
Subject: [PATCH] add taskSdkRule
---
userApi.go | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/userApi.go b/userApi.go
index ddff79b..3fe02d6 100644
--- a/userApi.go
+++ b/userApi.go
@@ -1 +1,24 @@
package dbapi
+
+import "encoding/json"
+
+type UserApi struct {
+
+}
+
+func (api UserApi) Login(username string,password string) (bool,interface{}){
+ url := BASIC_URL + DATA_URL_PREFIX + "/user/login"
+ client := NewClient()
+ paramBody :=make(map[string]interface{},0)
+ paramBody["username"]=username
+ paramBody["password"]=password
+ respBody, err := client.DoPostRequest(url, CONTENT_TYPE_JSON, 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