This commit is contained in:
苏尹岚
2021-04-16 18:03:05 +08:00
parent 19e5f5c140
commit 81ed9d41be
2 changed files with 0 additions and 7 deletions

View File

@@ -325,7 +325,6 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
return ErrInternalErrror
}
if !newAuthInfo.IsUserEmpty() {
globals.SugarLogger.Debugf("AddAuthBind user:33333333333333333333333 %v",)
return ErrAuthTypeAlreadyExist
}
RemoveUserInfo(newAuthInfo.Token)
@@ -336,12 +335,9 @@ func AddAuthBind(user IUser, newAuthInfo *AuthInfo) (err error) {
} else {
if handler := authers[newAuthInfo.AuthBindInfo.Type]; handler != nil {
newAuthInfo.AuthBindInfo.UserID = user.GetID()
globals.SugarLogger.Debugf("AddAuthBind user:111111111111111111111111111", )
handler.UnbindAuth(user.GetID(), newAuthInfo.GetAuthType(), newAuthInfo.GetAuthTypeID(), user.GetName())
globals.SugarLogger.Debugf("AddAuthBind user:2222222222222222222222222 %v", utils.Format4Output(newAuthInfo.AuthBindInfo,true))
err = handler.AddAuthBind(newAuthInfo.AuthBindInfo, user.GetName())
} else {
globals.SugarLogger.Debugf("AddAuthBind user:444444444444444444444444", )
err = ErrIllegalAuthType
}
}

View File

@@ -208,11 +208,9 @@ func (c *Auth2Controller) WeixinMPOAuth2() {
}
if params.Block != "" {
if moblie := params.Block[strings.LastIndex(params.Block,"=")+1:]; moblie != "" {
fmt.Println("moblie", moblie)
if user, err := dao.GetUserByID(dao.GetDB(), "mobile", moblie); err == nil {
if user != nil {
authInfo.AuthBindInfo.UserID = user.UserID
authInfo.UserID = user.UserID
authInfo.AuthBindInfo.AuthBind.UserID = user.UserID
auth2.AddAuthBind(user, authInfo)
} else {
@@ -223,7 +221,6 @@ func (c *Auth2Controller) WeixinMPOAuth2() {
}
if strings.Contains(params.Block,"?"){
params.Block = params.Block[:strings.LastIndex(params.Block,"?" )]
fmt.Println("params.Block", params.Block)
}
redirectURL = fmt.Sprintf("%s?info=%s", params.Block, base64.StdEncoding.EncodeToString(utils.MustMarshal(callResult)))
return retVal, model.ErrorCodeIgnore, err