by Robin at 20240425

This commit is contained in:
Leufolium 2024-04-25 18:31:34 +08:00
parent 50599bbe49
commit 4ffcf0a6a6
1 changed files with 0 additions and 12 deletions

View File

@ -8,7 +8,6 @@ import (
"service/library/configcenter" "service/library/configcenter"
"service/library/idgenerator" "service/library/idgenerator"
"service/library/logger" "service/library/logger"
"service/library/redis"
"strconv" "strconv"
"time" "time"
@ -158,9 +157,6 @@ func (p *Token) OpVerifyValid(ctx *gin.Context, token *jwt.Token) error {
if err != nil { if err != nil {
return fmt.Errorf("failed to acquire token_uuid from token") return fmt.Errorf("failed to acquire token_uuid from token")
} }
if ctx.Request.Header.Get("Is-For-Test") != "" {
redis.GetRedisClient().Set("token:token_uuid", tokenUuid, 300)
}
list, err := p.OpList(ctx, &tokenproto.OpListReq{ list, err := p.OpList(ctx, &tokenproto.OpListReq{
Id: tokenUuid, Id: tokenUuid,
@ -168,14 +164,6 @@ func (p *Token) OpVerifyValid(ctx *gin.Context, token *jwt.Token) error {
if err != nil { if err != nil {
return fmt.Errorf("OpList failed") return fmt.Errorf("OpList failed")
} }
if ctx.Request.Header.Get("Is-For-Test") != "" {
if len(list) > 0 {
for i, v := range list {
redis.GetRedisClient().Set("token:"+fmt.Sprint(i), v.Id, 300)
}
}
}
if len(list) == 0 { if len(list) == 0 {
return fmt.Errorf("登录失效,请重新登录!") return fmt.Errorf("登录失效,请重新登录!")
} }