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