更新token有效期限制
This commit is contained in:
parent
ca24f14eaa
commit
cdb7512cd9
@ -90,7 +90,7 @@ public class Constants
|
|||||||
/**
|
/**
|
||||||
* 令牌有效期(分钟)
|
* 令牌有效期(分钟)
|
||||||
*/
|
*/
|
||||||
public final static long TOKEN_EXPIRE = 720;
|
public final static long TOKEN_EXPIRE = 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参数管理 cache key
|
* 参数管理 cache key
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public class TokenService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RedisService redisService;
|
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;
|
private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(AuthFilter.class);
|
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自行添加
|
// 排除过滤的 uri 地址,nacos自行添加
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -94,7 +94,7 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||||||
|
|
||||||
return response.writeWith(Mono.fromSupplier(() -> {
|
return response.writeWith(Mono.fromSupplier(() -> {
|
||||||
DataBufferFactory bufferFactory = response.bufferFactory();
|
DataBufferFactory bufferFactory = response.bufferFactory();
|
||||||
return bufferFactory.wrap(JSON.toJSONBytes(R.fail(msg)));
|
return bufferFactory.wrap(JSON.toJSONBytes(R.fail(499, msg)));
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user