🔖 Releasing / Version tags. 3.7.4

This commit is contained in:
lbw 2024-01-28 23:09:39 +08:00
parent 6c2c989e42
commit 9e2f1aaba5
2 changed files with 54 additions and 53 deletions

View File

@ -21,59 +21,62 @@ import org.springframework.data.redis.core.RedisTemplate;
@EnableConfigurationProperties(GatewayConfigProperties.class)
public class GatewayConfiguration {
/**
* 创建密码解码器过滤器
* @param modifyRequestBodyGatewayFilterFactory 修改请求体网关过滤器工厂
* @param configProperties 配置属性
* @return 密码解码器过滤器
*/
@Bean
public PasswordDecoderFilter passwordDecoderFilter(
ModifyRequestBodyGatewayFilterFactory modifyRequestBodyGatewayFilterFactory,
GatewayConfigProperties configProperties) {
return new PasswordDecoderFilter(modifyRequestBodyGatewayFilterFactory, configProperties);
}
/**
* 创建密码解码器过滤器
*
* @param modifyRequestBodyGatewayFilterFactory 修改请求体网关过滤器工厂
* @param configProperties 配置属性
* @return 密码解码器过滤器
*/
@Bean
public PasswordDecoderFilter passwordDecoderFilter(
ModifyRequestBodyGatewayFilterFactory modifyRequestBodyGatewayFilterFactory,
GatewayConfigProperties configProperties) {
return new PasswordDecoderFilter(modifyRequestBodyGatewayFilterFactory, configProperties);
}
/**
* 创建PigRequest全局过滤器
* @return PigRequest全局过滤器
*/
@Bean
public PigRequestGlobalFilter pigRequestGlobalFilter() {
return new PigRequestGlobalFilter();
}
/**
* 创建PigRequest全局过滤器
*
* @return PigRequest全局过滤器
*/
@Bean
public PigRequestGlobalFilter pigRequestGlobalFilter() {
return new PigRequestGlobalFilter();
}
/**
* 创建验证码网关过滤器
* @param configProperties 配置属性
* @param objectMapper 对象映射器
* @param redisTemplate Redis模板
* @return 验证码网关过滤器
*/
@Bean
public ValidateCodeGatewayFilter validateCodeGatewayFilter(GatewayConfigProperties configProperties,
ObjectMapper objectMapper, RedisTemplate redisTemplate) {
return new ValidateCodeGatewayFilter(configProperties, objectMapper, redisTemplate);
}
/**
* 创建验证码网关过滤器
*
* @param configProperties 配置属性
* @param redisTemplate Redis模板
* @return 验证码网关过滤器
*/
@Bean
public ValidateCodeGatewayFilter validateCodeGatewayFilter(GatewayConfigProperties configProperties, RedisTemplate redisTemplate) {
return new ValidateCodeGatewayFilter(configProperties, redisTemplate);
}
/**
* 创建全局异常处理程序
* @param objectMapper 对象映射器
* @return 全局异常处理程序
*/
@Bean
public GlobalExceptionHandler globalExceptionHandler(ObjectMapper objectMapper) {
return new GlobalExceptionHandler(objectMapper);
}
/**
* 创建全局异常处理程序
*
* @param objectMapper 对象映射器
* @return 全局异常处理程序
*/
@Bean
public GlobalExceptionHandler globalExceptionHandler(ObjectMapper objectMapper) {
return new GlobalExceptionHandler(objectMapper);
}
/**
* 创建图片验证码处理器
* @param redisTemplate Redis模板
* @return 图片验证码处理器
*/
@Bean
public ImageCodeHandler imageCodeHandler(RedisTemplate redisTemplate) {
return new ImageCodeHandler(redisTemplate);
}
/**
* 创建图片验证码处理器
*
* @param redisTemplate Redis模板
* @return 图片验证码处理器
*/
@Bean
public ImageCodeHandler imageCodeHandler(RedisTemplate redisTemplate) {
return new ImageCodeHandler(redisTemplate);
}
}

View File

@ -54,8 +54,6 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory<Obje
private final GatewayConfigProperties configProperties;
private final ObjectMapper objectMapper;
private final RedisTemplate<String, Object> redisTemplate;
/**
@ -89,7 +87,7 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory<Obje
CharsetUtil.CHARSET_UTF_8);
// 刷新请求跳过直接向下执行
if (StrUtil.equals(SecurityConstants.REFRESH_TOKEN, requestBodyMap.get("grant_type"))) {
return chain.filter(exchange);
return chain.filter(exchange.mutate().request(serverHttpRequest).build());
}
// 根据 randomStr 参数判断验证码是否正常