Merge pull request 'by Robin at 20240425' (#339) from dev-feat-IRONFANS-70-Robin into feat-IRONFANS-70

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/339
This commit is contained in:
chenhao 2024-04-25 18:27:08 +08:00
commit cd7eb88088
1 changed files with 4 additions and 1 deletions

View File

@ -158,6 +158,9 @@ 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,7 +171,7 @@ func (p *Token) OpVerifyValid(ctx *gin.Context, token *jwt.Token) error {
if ctx.Request.Header.Get("Is-For-Test") != "" { if ctx.Request.Header.Get("Is-For-Test") != "" {
if len(list) > 0 { if len(list) > 0 {
for i, v := range list { for i, v := range list {
redis.GetRedisClient().Set("token::"+fmt.Sprint(i), v.Id, 300) redis.GetRedisClient().Set("token:"+fmt.Sprint(i), v.Id, 300)
} }
} }
} }