This commit is contained in:
richboo111
2022-08-12 09:46:01 +08:00
parent 8170627fbb
commit 37b874fb1e

View File

@@ -160,6 +160,7 @@ func getFixedTokenName(token string) *AuthInfo {
func createAuthInfo(user IUser, authBindInfo *AuthBindEx) (authInfo *AuthInfo) {
token, tokenType := createToken(user, authBindInfo)
//user为空 tokenType=2
globals.SugarLogger.Debug("tokentokenType============", token, tokenType)
expireDuration := DefTokenDuration
authInfo = &AuthInfo{
@@ -365,9 +366,11 @@ func DecryptUserMsg(sessionKey, iv, msg string) (string, error) {
// 通过临时TOKEN绑定新创建的用户
func BindUser(inauthInfo *AuthInfo, user IUser) (outauthInfo *AuthInfo, err error) {
if err = AddAuthBind(user, inauthInfo); err == nil {
globals.SugarLogger.Debug("进入AddAuthBind=============输出一下user.GetID()", user.GetID())
inauthInfo.AuthBindInfo.UserID = user.GetID()
outauthInfo = createAuthInfo(user, inauthInfo.AuthBindInfo)
}
globals.SugarLogger.Debug("=============输出一下outauthInfo", outauthInfo)
return outauthInfo, err
}