mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
添加6401 token 过期状态
This commit is contained in:
@@ -391,7 +391,7 @@ func (mw *GinJWTMiddleware) middlewareImpl(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if int64(claims["exp"].(float64)) < mw.TimeFunc().Unix() {
|
||||
mw.unauthorized(c, http.StatusUnauthorized, mw.HTTPStatusMessageFunc(ErrExpiredToken, c))
|
||||
mw.unauthorized(c, 6401, mw.HTTPStatusMessageFunc(ErrExpiredToken, c))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -680,8 +680,6 @@ func (mw *GinJWTMiddleware) ParseToken(c *gin.Context) (*jwt.Token, error) {
|
||||
if mw.usingPublicKeyAlgo() {
|
||||
return mw.pubKey, nil
|
||||
}
|
||||
|
||||
// save token string if vaild
|
||||
c.Set("JWT_TOKEN", token)
|
||||
|
||||
return mw.Key, nil
|
||||
|
||||
Reference in New Issue
Block a user