2
0

fix: 登录失效时间改为6小时和取消刷新失效时间

This commit is contained in:
caiyuchao
2025-02-28 11:13:29 +08:00
parent e739cc110a
commit dcc64b2de9
2 changed files with 8 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ public class CacheConstants
/** /**
* 缓存有效期默认720分钟 * 缓存有效期默认720分钟
*/ */
public final static long EXPIRATION = 720; public final static long EXPIRATION = 360;
/** /**
* 缓存刷新时间默认120分钟 * 缓存刷新时间默认120分钟

View File

@@ -1,15 +1,12 @@
package org.wfc.common.security.service; package org.wfc.common.security.service;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.wfc.common.core.constant.CacheConstants; import org.wfc.common.core.constant.CacheConstants;
import org.wfc.common.core.constant.SecurityConstants; import org.wfc.common.core.constant.SecurityConstants;
import org.wfc.common.core.domain.LoginUser;
import org.wfc.common.core.utils.JwtUtils; import org.wfc.common.core.utils.JwtUtils;
import org.wfc.common.core.utils.ServletUtils; import org.wfc.common.core.utils.ServletUtils;
import org.wfc.common.core.utils.StringUtils; import org.wfc.common.core.utils.StringUtils;
@@ -17,10 +14,14 @@ import org.wfc.common.core.utils.ip.IpUtils;
import org.wfc.common.core.utils.uuid.IdUtils; import org.wfc.common.core.utils.uuid.IdUtils;
import org.wfc.common.redis.service.RedisService; import org.wfc.common.redis.service.RedisService;
import org.wfc.common.security.utils.SecurityUtils; import org.wfc.common.security.utils.SecurityUtils;
import org.wfc.common.core.domain.LoginUser;
import org.wfc.system.api.domain.SysUser; import org.wfc.system.api.domain.SysUser;
import org.wfc.user.api.domain.UUser; import org.wfc.user.api.domain.UUser;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/** /**
* token验证处理 * token验证处理
* *
@@ -165,7 +166,7 @@ public class TokenService
long currentTime = System.currentTimeMillis(); long currentTime = System.currentTimeMillis();
if (expireTime - currentTime <= MILLIS_MINUTE_TEN) if (expireTime - currentTime <= MILLIS_MINUTE_TEN)
{ {
refreshToken(loginUser); // refreshToken(loginUser);
} }
} }