wx绑定
This commit is contained in:
@@ -396,11 +396,13 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
|
|||||||
func AddAuthBindWithMobile(authInfo *AuthInfo, mobile string) (err error) {
|
func AddAuthBindWithMobile(authInfo *AuthInfo, mobile string) (err error) {
|
||||||
if handler := authers[authInfo.AuthBindInfo.Type]; handler != nil {
|
if handler := authers[authInfo.AuthBindInfo.Type]; handler != nil {
|
||||||
user, err := dao.GetUserByID(dao.GetDB(), "mobile", mobile)
|
user, err := dao.GetUserByID(dao.GetDB(), "mobile", mobile)
|
||||||
|
globals.SugarLogger.Debug("user===============", user)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("此接口有执行顺序,请先调用注册登录接口:【第一步:Login,第二不:TiktokDecrypt】")
|
return errors.New("此接口有执行顺序,请先调用注册登录接口:【第一步:Login,第二不:TiktokDecrypt】")
|
||||||
}
|
}
|
||||||
authInfo.AuthBindInfo.UserID = user.UserID
|
authInfo.AuthBindInfo.UserID = user.UserID
|
||||||
//handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())
|
//handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())
|
||||||
|
globals.SugarLogger.Debug("authInfo.AuthBindInfo,user.GetName()===============", authInfo.AuthBindInfo, user.GetName())
|
||||||
err = handler.AddAuthBind(authInfo.AuthBindInfo, user.GetName())
|
err = handler.AddAuthBind(authInfo.AuthBindInfo, user.GetName())
|
||||||
} else {
|
} else {
|
||||||
err = ErrIllegalAuthType
|
err = ErrIllegalAuthType
|
||||||
|
|||||||
@@ -343,6 +343,7 @@ func (c *Auth2Controller) AddAuthBindWithMobile() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
}
|
}
|
||||||
|
globals.SugarLogger.Debug("打印newAuthInfo==============", newAuthInfo)
|
||||||
err = auth2.AddAuthBindWithMobile(newAuthInfo, params.Mobile)
|
err = auth2.AddAuthBindWithMobile(newAuthInfo, params.Mobile)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user