This commit is contained in:
苏尹岚
2021-04-16 14:42:54 +08:00
parent 1b3c71f470
commit 809c046994
3 changed files with 12 additions and 0 deletions

View File

@@ -184,6 +184,7 @@ func (c *Auth2Controller) WeixinOAuth2() {
// @Param code query string true "客户同意后得到的code"
// @Param block query string true "回调地址"
// @Param state query string false "微信回调的登录状态"
// @Param mobile query string false "手机号"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /WeixinMPOAuth2 [get]
@@ -206,6 +207,15 @@ func (c *Auth2Controller) WeixinMPOAuth2() {
Desc: err.Error(),
}
}
if params.Mobile != "" {
if user, err := dao.GetUserByID(dao.GetDB(), "mobile", params.Mobile); err == nil {
if user != nil {
} else {
return retVal, errCode, fmt.Errorf("未查询到用户mobile :%v", params.Mobile)
}
}
}
redirectURL = fmt.Sprintf("%s?info=%s", params.Block, base64.StdEncoding.EncodeToString(utils.MustMarshal(callResult)))
return retVal, model.ErrorCodeIgnore, err
})