From f15b85bbe72ebd2b185c767ed0dbe8e35ab68d1c Mon Sep 17 00:00:00 2001 From: richboo111 Date: Thu, 11 Aug 2022 15:06:33 +0800 Subject: [PATCH] dd --- business/auth2/auth2.go | 20 ++++++++++---------- business/auth2/authprovider/defauther.go | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/business/auth2/auth2.go b/business/auth2/auth2.go index 49f27b3eb..04c08eaa1 100644 --- a/business/auth2/auth2.go +++ b/business/auth2/auth2.go @@ -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 } diff --git a/business/auth2/authprovider/defauther.go b/business/auth2/authprovider/defauther.go index d4836f048..bd2bdb608 100644 --- a/business/auth2/authprovider/defauther.go +++ b/business/auth2/authprovider/defauther.go @@ -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 }