更新token有效期限制

This commit is contained in:
panshuling321 2022-08-05 09:32:24 +08:00
parent ca24f14eaa
commit cdb7512cd9
3 changed files with 4 additions and 4 deletions

View File

@ -90,7 +90,7 @@ public class Constants
/**
* 令牌有效期分钟
*/
public final static long TOKEN_EXPIRE = 720;
public final static long TOKEN_EXPIRE = 10;
/**
* 参数管理 cache key

View File

@ -27,7 +27,7 @@ public class TokenService {
@Autowired
private RedisService redisService;
private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 6000;
private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 60;
private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;

View File

@ -37,7 +37,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
private static final Logger log = LoggerFactory.getLogger(AuthFilter.class);
private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 600000;
private final static long EXPIRE_TIME = Constants.TOKEN_EXPIRE * 60;
// 排除过滤的 uri 地址nacos自行添加
@Autowired
@ -94,7 +94,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
return response.writeWith(Mono.fromSupplier(() -> {
DataBufferFactory bufferFactory = response.bufferFactory();
return bufferFactory.wrap(JSON.toJSONBytes(R.fail(msg)));
return bufferFactory.wrap(JSON.toJSONBytes(R.fail(499, msg)));
}));
}