This commit is contained in:
parent
f4380e6b52
commit
fd7cec8224
|
@ -2,6 +2,7 @@ package logic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"service/api/base"
|
||||||
tokenproto "service/api/proto/token/proto"
|
tokenproto "service/api/proto/token/proto"
|
||||||
"service/app/mix/dao"
|
"service/app/mix/dao"
|
||||||
"service/dbstruct"
|
"service/dbstruct"
|
||||||
|
@ -168,5 +169,11 @@ func (p *Token) OpVerifyValid(ctx *gin.Context, token *jwt.Token) (int64, error)
|
||||||
return -1, fmt.Errorf("登录失效,请重新登录!")
|
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
|
return tokenUuid, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue