sys.visit.tokentime解析出错加保护

This commit is contained in:
sxu 2025-05-16 18:34:20 +08:00
parent f34656b648
commit 9eb49e1b09
1 changed files with 6 additions and 2 deletions

View File

@ -206,8 +206,12 @@ public class TokenService {
private Long getTokenTime(){
long tokenTime = 20L;
String redisResult = redisService.getCacheObject("sys_config:"+ "sys.visit.tokentime");
if(!redisResult.isEmpty()) {
tokenTime = Long.parseLong(redisResult);
if(StringUtils.isNotEmpty(redisResult)) {
try {
tokenTime = Long.parseLong(redisResult);
} catch (Exception e) {
tokenTime = 43200L; //MINUTES
}
}else {
Long result = systemConfig.getTokenTime();
if (!ObjectUtil.isEmpty(result)){