mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix bug
This commit is contained in:
@@ -218,11 +218,13 @@ public class JWTValidator {
|
||||
* @param leeway 容忍空间,单位:秒。向后容忍
|
||||
* @throws ValidateException 验证异常
|
||||
*/
|
||||
private static void validateNotAfter(final String fieldName, final Date dateToCheck, final Date now, final long leeway) throws ValidateException {
|
||||
private static void validateNotAfter(final String fieldName, final Date dateToCheck, Date now, final long leeway) throws ValidateException {
|
||||
if (null == dateToCheck) {
|
||||
return;
|
||||
}
|
||||
now.setTime(now.getTime() + leeway * 1000);
|
||||
if(leeway > 0){
|
||||
now = DateUtil.date(now.getTime() + leeway * 1000);
|
||||
}
|
||||
if (dateToCheck.after(now)) {
|
||||
throw new ValidateException("'{}':[{}] is after now:[{}]",
|
||||
fieldName, DateUtil.date(dateToCheck), DateUtil.date(now));
|
||||
|
Reference in New Issue
Block a user