dd
This commit is contained in:
@@ -83,7 +83,7 @@ type IAuther interface {
|
||||
SendVerifyCode(authID string) (verifyCode string, err error)
|
||||
// 负责验证secret,并找到相应的用户返回(password,email,mobile类型的不负责用户查找)如果找不到用户UserID为空
|
||||
VerifySecret(authID, authSecret string) (authBindEx *AuthBindEx, err error)
|
||||
AddAuthBind(authBindEx *AuthBindEx, userName string) (err error)
|
||||
pay(authBindEx *AuthBindEx, userName string) (err error)
|
||||
UnbindAuth(userID, authType, authTypeID, userName string) (err error)
|
||||
Logout(authInfo *AuthInfo) (err error)
|
||||
GetUserType() (userType int8)
|
||||
@@ -263,15 +263,15 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
|
||||
// 返回authBind中UserID为空表示只是认证,但本地没有记录,这种情况会返回临时TOKEN
|
||||
if authBindEx.UserHint != nil && authBindEx.UserID == "" {
|
||||
// 利用得到受信任的信息查找用户
|
||||
if authBindEx.UserHint.Mobile != "" {
|
||||
user = userProvider.GetUser(authBindEx.UserHint.Mobile, UserIDMobile)
|
||||
}
|
||||
if user == nil && authBindEx.UserHint.Email != "" {
|
||||
user = userProvider.GetUser(authBindEx.UserHint.Email, UserIDEmail)
|
||||
}
|
||||
if user != nil {
|
||||
authBindEx.UserID = user.GetID()
|
||||
}
|
||||
// if authBindEx.UserHint.Mobile != "" {
|
||||
// user = userProvider.GetUser(authBindEx.UserHint.Mobile, UserIDMobile)
|
||||
// }
|
||||
// if user == nil && authBindEx.UserHint.Email != "" {
|
||||
// user = userProvider.GetUser(authBindEx.UserHint.Email, UserIDEmail)
|
||||
// }
|
||||
// if user != nil {
|
||||
// authBindEx.UserID = user.GetID()
|
||||
// }
|
||||
if user2 := userProvider.GetUser(authBindEx.UserHint.Email, UserIDMobile); user2 != nil {
|
||||
user = user2
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ func (a *DefAuther) UnionFindAuthBind(curAuthType, curAuthTypeID string, unionAu
|
||||
}
|
||||
a.UnbindAuth(authBind.UserID, curAuthType, curAuthTypeID, model.AdminName)
|
||||
err = a.AddAuthBind(authBindEx, model.AdminName) // 自动绑定
|
||||
globals.SugarLogger.Debug("authBindEx AddAuthBind err============", authBindEx, err)
|
||||
} else if dao.IsNoRowsError(err) {
|
||||
err = nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user