diff --git a/business/auth2/auth2.go b/business/auth2/auth2.go index c0962be81..a4ee4ac0c 100644 --- a/business/auth2/auth2.go +++ b/business/auth2/auth2.go @@ -160,6 +160,7 @@ func getFixedTokenName(token string) *AuthInfo { func createAuthInfo(user IUser, authBindInfo *AuthBindEx) (authInfo *AuthInfo) { token, tokenType := createToken(user, authBindInfo) + globals.SugarLogger.Debug("token,tokenType============", token, tokenType) expireDuration := DefTokenDuration authInfo = &AuthInfo{ AuthBindInfo: authBindInfo, @@ -272,9 +273,12 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string // if user != nil { // authBindEx.UserID = user.GetID() // } - if user2 := userProvider.GetUser(authBindEx.UserHint.Email, UserIDMobile); user2 != nil { + if user2 := userProvider.GetUser(authBindEx.AuthID2, "auth_id2"); err != nil { user = user2 } + //if user2 := userProvider.GetUser(authBindEx.UserHint.Email, UserIDMobile); user2 != nil { + // user = user2 + //} globals.SugarLogger.Debug("user检测1=============", user) } else if authBindEx.UserID != "" { user = userProvider.GetUser(authBindEx.UserID, UserIDID) diff --git a/business/auth2/authprovider/dingding/qrcode.go b/business/auth2/authprovider/dingding/qrcode.go index 7d78ac6b1..81392e429 100644 --- a/business/auth2/authprovider/dingding/qrcode.go +++ b/business/auth2/authprovider/dingding/qrcode.go @@ -30,7 +30,7 @@ func (a *QRCodeAuther) VerifySecret(dummy, code string) (authBindEx *auth2.AuthB if authBindEx, err = a.UnionFindAuthBind(AuthTypeQRCode, api.DingDingQRCodeAPI.GetAppID(), []string{AuthTypeStaff, AuthTypeQRCode}, userQRInfo.OpenID, userQRInfo.UnionID, userQRInfo); err == nil { authBindEx.UserHint = &auth2.UserBasic{ Name: userQRInfo.Nickname, - //UserID: userQRInfo., + //UserID: userQR Info., } } }