From 60418276bd9085959382bfe7149ac91c7d7389c0 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 30 Mar 2022 20:04:12 +0800 Subject: [PATCH] oa notification add --- pkg/common/token_verify/jwt_token.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/common/token_verify/jwt_token.go b/pkg/common/token_verify/jwt_token.go index 28d6cf314..69b112bf7 100644 --- a/pkg/common/token_verify/jwt_token.go +++ b/pkg/common/token_verify/jwt_token.go @@ -139,7 +139,6 @@ func GetUserIDFromToken(token string, operationID string) (bool, string) { } func ParseToken(tokensString, operationID string) (claims *Claims, err error) { - claims, err = GetClaimFromToken(tokensString) if err != nil { log.NewError(operationID, "token validate err", err.Error(), tokensString) @@ -158,11 +157,12 @@ func ParseToken(tokensString, operationID string) (claims *Claims, err error) { if v, ok := m[tokensString]; ok { switch v { case constant.NormalToken: - log.NewDebug("", "this is normal return", claims) + log.NewDebug(operationID, "this is normal return", claims) return claims, nil case constant.InValidToken: return nil, &constant.ErrTokenInvalid case constant.KickedToken: + log.Error(operationID, "this token has been kicked by other same terminal ", constant.ErrTokenKicked) return nil, &constant.ErrTokenKicked case constant.ExpiredToken: return nil, &constant.ErrTokenExpired @@ -170,6 +170,7 @@ func ParseToken(tokensString, operationID string) (claims *Claims, err error) { return nil, &constant.ErrTokenUnknown } } + log.NewError(operationID, "redis token map not find", constant.ErrTokenUnknown) return nil, &constant.ErrTokenUnknown }