mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-23 05:37:48 +08:00
即将过期状态判断错误
This commit is contained in:
parent
a948b78629
commit
5aaa1c016b
@ -231,7 +231,7 @@ public class JwtUtils implements InitializingBean {
|
|||||||
if (expirationTime != null) {
|
if (expirationTime != null) {
|
||||||
// 判断是否即将过期, 默认剩余时间小于5分钟未即将过期
|
// 判断是否即将过期, 默认剩余时间小于5分钟未即将过期
|
||||||
// 剩余时间 (秒)
|
// 剩余时间 (秒)
|
||||||
long timeRemaining = LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8)) - expirationTime.getValue();
|
long timeRemaining = expirationTime.getValue() - LocalDateTime.now().toEpochSecond(ZoneOffset.ofHours(8));
|
||||||
if (timeRemaining < 5 * 60) {
|
if (timeRemaining < 5 * 60) {
|
||||||
jwtUser.setStatus(JwtUser.TokenStatus.EXPIRING_SOON);
|
jwtUser.setStatus(JwtUser.TokenStatus.EXPIRING_SOON);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user