fix: token有效期修改为,90天。
This commit is contained in:
@@ -8,14 +8,14 @@ package com.intc.common.core.constant;
|
||||
public class CacheConstants
|
||||
{
|
||||
/**
|
||||
* 缓存有效期,默认720(分钟)
|
||||
* 缓存有效期,默认129600(分钟,90天)
|
||||
*/
|
||||
public final static long EXPIRATION = 720;
|
||||
public final static long EXPIRATION = 129600;
|
||||
|
||||
/**
|
||||
* 缓存刷新时间,默认120(分钟)
|
||||
* 缓存刷新时间,默认10080(分钟,7天)
|
||||
*/
|
||||
public final static long REFRESH_TIME = 120;
|
||||
public final static long REFRESH_TIME = 10080;
|
||||
|
||||
/**
|
||||
* 密码最大错误次数
|
||||
|
||||
@@ -94,7 +94,7 @@ public class AuthLogic
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证当前用户有效期, 如果相差不足120分钟,自动刷新缓存
|
||||
* 验证当前用户有效期, 如果相差不足配置的刷新时间,自动刷新缓存
|
||||
*
|
||||
* @param loginUser 当前用户信息
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ public class TokenService
|
||||
|
||||
private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;
|
||||
|
||||
private final static Long MILLIS_MINUTE_TEN = CacheConstants.REFRESH_TIME * MILLIS_MINUTE;
|
||||
private final static Long MILLIS_REFRESH_TIME = CacheConstants.REFRESH_TIME * MILLIS_MINUTE;
|
||||
|
||||
/**
|
||||
* 创建令牌
|
||||
@@ -134,7 +134,7 @@ public class TokenService
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证令牌有效期,相差不足120分钟,自动刷新缓存
|
||||
* 验证令牌有效期,相差不足配置的刷新时间,自动刷新缓存
|
||||
*
|
||||
* @param loginUser
|
||||
*/
|
||||
@@ -142,7 +142,7 @@ public class TokenService
|
||||
{
|
||||
long expireTime = loginUser.getExpireTime();
|
||||
long currentTime = System.currentTimeMillis();
|
||||
if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
|
||||
if (expireTime - currentTime <= MILLIS_REFRESH_TIME)
|
||||
{
|
||||
refreshToken(loginUser);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user