Merge remote-tracking branch 'origin/mark' into yonghui

This commit is contained in:
苏尹岚
2020-01-06 15:43:02 +08:00
5 changed files with 27 additions and 20 deletions

View File

@@ -13,6 +13,7 @@ import (
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/password"
"git.rosy.net.cn/jx-callback/business/auth2/authprovider/weixin"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/jx-callback/globals"
"github.com/astaxie/beego"
)
@@ -66,7 +67,13 @@ func (c *Auth2Controller) CreateCaptcha() {
// @router /SendVerifyCode [post]
func (c *Auth2Controller) SendVerifyCode() {
c.callSendVerifyCode(func(params *tAuth2SendVerifyCodeParams) (retVal interface{}, errCode string, err error) {
err = auth2.SendVerifyCode(params.AuthToken, params.CaptchaID, params.CaptchaValue, params.AuthID)
code, authInfo, err := auth2.SendVerifyCode(params.AuthToken, params.CaptchaID, params.CaptchaValue, params.AuthID)
if err == nil && authInfo != nil {
user, err2 := dao.GetUserByID(dao.GetDB(), "user_id", authInfo.GetID())
if err2 == nil && user.Type&(model.UserTypeBoss|model.UserTypeOperator) != 0 {
retVal = code
}
}
return retVal, "", err
})
}