mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-09-21 20:35:16 +00:00
jwt异地登陆bug修复
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user