jwt异地登陆bug修复

This commit is contained in:
QM303176530
2020-04-08 20:15:13 +08:00
parent 71095f3e2e
commit 5b29b661dc
2 changed files with 3 additions and 6 deletions
+2 -4
View File
@@ -26,7 +26,7 @@ func JWTAuth() gin.HandlerFunc {
c.Abort()
return
}
if service.IsBlacklist(token,modelToken) {
if service.IsBlacklist(token, &modelToken) {
response.Result(response.ERROR, gin.H{
"reload": true,
}, "您的帐户异地登陆或令牌失效", c)
@@ -66,8 +66,6 @@ var (
TokenInvalid error = errors.New("Couldn't handle this token:")
)
func NewJWT() *JWT {
return &JWT{
[]byte(global.GVA_CONFIG.JWT.SigningKey),
@@ -75,7 +73,7 @@ func NewJWT() *JWT {
}
//创建一个token
func (j *JWT) CreateToken(claims request. CustomClaims) (string, error) {
func (j *JWT) CreateToken(claims request.CustomClaims) (string, error) {
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
return token.SignedString(j.SigningKey)
}