diff --git a/business/auth2/auth2.go b/business/auth2/auth2.go index c0962be81..49f27b3eb 100644 --- a/business/auth2/auth2.go +++ b/business/auth2/auth2.go @@ -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 }