test登录

This commit is contained in:
苏尹岚
2020-09-23 14:49:18 +08:00
parent b53ddbeb7c
commit 2ffbc14b4d

View File

@@ -4,7 +4,6 @@ import (
"bytes"
"encoding/base64"
"errors"
"fmt"
"regexp"
"strings"
"time"
@@ -244,7 +243,7 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
realAuthID = user.GetID()
}
if authBindEx, err = handler.VerifySecret(realAuthID, authSecret); err == nil {
// globals.SugarLogger.Debugf("auth2 Login authBindEx:%s", utils.Format4Output(authBindEx, false))
globals.SugarLogger.Debugf("testttttttttttttttttttttttttttttttttttt", utils.Format4Output(authBindEx, false))
if authBindEx == nil { // mobile, email会返回nil表示不会新建AuthBind实体
user = userProvider.GetUser(authID, authIDType)
authBindEx = &AuthBindEx{
@@ -271,7 +270,6 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
user = userProvider.GetUser(authBindEx.UserID, UserIDID)
}
}
fmt.Println("test2222222222222222222222222222222", utils.Format4Output(user, false))
authInfo = createAuthInfo(user, authBindEx)
if user != nil && user.GetID() != "" {
userProvider.UpdateLastLogin(user.GetID(), authType, ctx.GetRealRemoteIP())
@@ -401,7 +399,6 @@ func createToken(user IUser, authBindInfo *AuthBindEx) (token string, tokenType
userID := TokenUserEmpty
userName := authBindInfo.AuthID
tokenType = TokenTypeOnlyAuth
fmt.Println("test111111111111111111111", utils.Format4Output(user, false))
if user != nil {
userID = user.GetID()
userName = "[" + user.GetID2() + "]"