- auth2与auth在小程序登录成功后,如有必要刷新openID
This commit is contained in:
@@ -77,6 +77,7 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType string, unionAuthTypeList []st
|
||||
authBindEx = &auth2.AuthBindEx{
|
||||
AuthBind: *authBind,
|
||||
}
|
||||
a.UnbindAuth(authBind.UserID, curAuthType, model.AdminName)
|
||||
err = a.AddAuthBind(authBindEx, model.AdminName) // 自动绑定
|
||||
} else if dao.IsNoRowsError(err) {
|
||||
err = nil
|
||||
|
||||
@@ -228,6 +228,10 @@ func (a *AutherMiniProgram) Login(mobileNum, code string) (userID, LoginType str
|
||||
if err != nil {
|
||||
return "", "", auth.ConvertErr2NoUser(err, mobileNum)
|
||||
}
|
||||
if user.OpenIDMini != sessionInfo.OpenID {
|
||||
user.OpenIDMini = sessionInfo.OpenID
|
||||
dao.UpdateEntity(db, user, "OpenIDMini")
|
||||
}
|
||||
globals.SugarLogger.Debugf("AutherMiniProgram Login user.Tel:%s, code:%s, openID:%s", user.Tel, code, sessionInfo.OpenID)
|
||||
if mobileNum != user.Tel {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user