fix: token有效期修改为,90天。

This commit is contained in:
tianyongbao
2026-07-12 10:05:51 +08:00
parent 4f9bac5536
commit 9f45998426
3 changed files with 8 additions and 8 deletions

View File

@@ -8,14 +8,14 @@ package com.intc.common.core.constant;
public class CacheConstants 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;
/** /**
* 密码最大错误次数 * 密码最大错误次数

View File

@@ -94,7 +94,7 @@ public class AuthLogic
} }
/** /**
* 验证当前用户有效期, 如果相差不足120分钟,自动刷新缓存 * 验证当前用户有效期, 如果相差不足配置的刷新时间,自动刷新缓存
* *
* @param loginUser 当前用户信息 * @param loginUser 当前用户信息
*/ */

View File

@@ -36,7 +36,7 @@ public class TokenService
private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY; 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 * @param loginUser
*/ */
@@ -142,7 +142,7 @@ public class TokenService
{ {
long expireTime = loginUser.getExpireTime(); long expireTime = loginUser.getExpireTime();
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
if (expireTime - currentTime <= MILLIS_MINUTE_TEN) if (expireTime - currentTime <= MILLIS_REFRESH_TIME)
{ {
refreshToken(loginUser); refreshToken(loginUser);
} }