mirror of
https://github.com/201206030/novel-plus.git
synced 2025-08-24 08:12:43 +00:00
修复jwt校验失败后的bug
This commit is contained in:
@@ -86,15 +86,19 @@ public class JwtTokenUtil {
|
||||
*/
|
||||
private boolean isTokenExpired(String token) {
|
||||
Date expiredDate = getExpiredDateFromToken(token);
|
||||
if(expiredDate == null){
|
||||
return true;
|
||||
}else {
|
||||
return expiredDate.before(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从token中获取过期时间
|
||||
*/
|
||||
private Date getExpiredDateFromToken(String token) {
|
||||
Claims claims = getClaimsFromToken(token);
|
||||
return claims.getExpiration();
|
||||
return claims != null ? claims.getExpiration() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user