Merge pull request #1928 from meqbyte/master

jwt剩余时间计算错误
This commit is contained in:
648540858
2025-07-28 08:32:24 +08:00
committed by GitHub

View File

@@ -231,7 +231,7 @@ public class JwtUtils implements InitializingBean {
if (expirationTime != null) {
// 判断是否即将过期, 默认剩余时间小于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) {
jwtUser.setStatus(JwtUser.TokenStatus.EXPIRING_SOON);
} else {