mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-27 01:30:51 +00:00
修复jwt校验失败后的bug
This commit is contained in:
parent
39c19ac004
commit
2fbda60617
@ -86,7 +86,11 @@ public class JwtTokenUtil {
|
||||
*/
|
||||
private boolean isTokenExpired(String token) {
|
||||
Date expiredDate = getExpiredDateFromToken(token);
|
||||
return expiredDate.before(new Date());
|
||||
if(expiredDate == null){
|
||||
return true;
|
||||
}else {
|
||||
return expiredDate.before(new Date());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,7 +98,7 @@ public class JwtTokenUtil {
|
||||
*/
|
||||
private Date getExpiredDateFromToken(String token) {
|
||||
Claims claims = getClaimsFromToken(token);
|
||||
return claims.getExpiration();
|
||||
return claims != null ? claims.getExpiration() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user