This commit is contained in:
Robin 2024-11-26 14:14:36 +08:00
parent f4380e6b52
commit fd7cec8224
1 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package logic
import (
"fmt"
"service/api/base"
tokenproto "service/api/proto/token/proto"
"service/app/mix/dao"
"service/dbstruct"
@ -168,5 +169,11 @@ func (p *Token) OpVerifyValid(ctx *gin.Context, token *jwt.Token) (int64, error)
return -1, fmt.Errorf("登录失效,请重新登录!")
}
// 校验是否本人
req := ctx.MustGet("client_req").(base.BaseRequestAccessible)
if list[1].Mid != req.GetBaseRequest().Mid {
return -1, fmt.Errorf("非法令牌!")
}
return tokenUuid, nil
}