This commit is contained in:
Daniel 2023-06-20 12:12:05 +08:00
parent 4459413493
commit 5f13dea7af
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 11 additions and 15 deletions

View file

@ -82,12 +82,8 @@ func deactivateUser(c *gin.Context) {
func login(c *gin.Context) {
ret := gulu.Ret.NewResult()
ret.Code = -1
arg := map[string]interface{}{}
if err := c.BindJSON(&arg); nil != err {
ret.Code = -1
ret.Msg = "parses request failed"
arg, ok := util.JsonArg(c, ret)
if !ok {
c.JSON(http.StatusOK, ret)
return
}
@ -96,10 +92,6 @@ func login(c *gin.Context) {
password := arg["userPassword"].(string)
captcha := arg["captcha"].(string)
cloudRegion := int(arg["cloudRegion"].(float64))
result, err := model.Login(name, password, captcha, cloudRegion)
if nil != err {
return
}
c.JSON(http.StatusOK, result)
ret = model.Login(name, password, captcha, cloudRegion)
c.JSON(http.StatusOK, ret)
}