diff --git a/app/mix/service/logic/token.go b/app/mix/service/logic/token.go index 407fdc1f..50665272 100644 --- a/app/mix/service/logic/token.go +++ b/app/mix/service/logic/token.go @@ -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 }