This commit is contained in:
aozhiwei 2021-01-07 10:26:35 +08:00
parent 5a972be601
commit efcfe08c97
2 changed files with 13 additions and 3 deletions

View File

@ -61,8 +61,18 @@ func (this *UserMgr) auth(c *f5.Context) {
func (this *UserMgr) _userLogin(c *f5.Context) {
url := "https://mp.kingsome.cn/api/user/login"
content := q5.NewMxoObject()
content.SetXValue("username", c.Request("username"))
content.SetXValue("password", c.Request("password"))
reqObj := struct {
UserName string `json:"username"`
Password string `json:"password"`
}{}
postBody := c.GetBody().GetString()
if err := json.Unmarshal([]byte(postBody), &reqObj); err != nil{
c.ResponseErr(500, "服务器内部错误")
return
}
f5.SysLog().Debug("boyd:%s", postBody)
content.SetXValue("username", q5.NewXString(reqObj.UserName))
content.SetXValue("password", q5.NewXString(reqObj.Password))
respStr := ""
if err := q5.HttpPostContent(url,
"application/json;charset=utf-8",

2
third_party/f5 vendored

@ -1 +1 @@
Subproject commit 089d415abc524ea3af32952ea34ff437da56f8ff
Subproject commit b4b8898e1192b286b00ba04628f1f28f7e0b4f13