🔖 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) @EnableConfigurationProperties(GatewayConfigProperties.class)
public class GatewayConfiguration { public class GatewayConfiguration {
/** /**
* 创建密码解码器过滤器 * 创建密码解码器过滤器
* @param modifyRequestBodyGatewayFilterFactory 修改请求体网关过滤器工厂 *
* @param configProperties 配置属性 * @param modifyRequestBodyGatewayFilterFactory 修改请求体网关过滤器工厂
* @return 密码解码器过滤器 * @param configProperties 配置属性
*/ * @return 密码解码器过滤器
@Bean */
public PasswordDecoderFilter passwordDecoderFilter( @Bean
ModifyRequestBodyGatewayFilterFactory modifyRequestBodyGatewayFilterFactory, public PasswordDecoderFilter passwordDecoderFilter(
GatewayConfigProperties configProperties) { ModifyRequestBodyGatewayFilterFactory modifyRequestBodyGatewayFilterFactory,
return new PasswordDecoderFilter(modifyRequestBodyGatewayFilterFactory, configProperties); GatewayConfigProperties configProperties) {
} return new PasswordDecoderFilter(modifyRequestBodyGatewayFilterFactory, configProperties);
}
/** /**
* 创建PigRequest全局过滤器 * 创建PigRequest全局过滤器
* @return PigRequest全局过滤器 *
*/ * @return PigRequest全局过滤器
@Bean */
public PigRequestGlobalFilter pigRequestGlobalFilter() { @Bean
return new PigRequestGlobalFilter(); public PigRequestGlobalFilter pigRequestGlobalFilter() {
} return new PigRequestGlobalFilter();
}
/** /**
* 创建验证码网关过滤器 * 创建验证码网关过滤器
* @param configProperties 配置属性 *
* @param objectMapper 对象映射器 * @param configProperties 配置属性
* @param redisTemplate Redis模板 * @param redisTemplate Redis模板
* @return 验证码网关过滤器 * @return 验证码网关过滤器
*/ */
@Bean @Bean
public ValidateCodeGatewayFilter validateCodeGatewayFilter(GatewayConfigProperties configProperties, public ValidateCodeGatewayFilter validateCodeGatewayFilter(GatewayConfigProperties configProperties, RedisTemplate redisTemplate) {
ObjectMapper objectMapper, RedisTemplate redisTemplate) { return new ValidateCodeGatewayFilter(configProperties, redisTemplate);
return new ValidateCodeGatewayFilter(configProperties, objectMapper, redisTemplate); }
}
/** /**
* 创建全局异常处理程序 * 创建全局异常处理程序
* @param objectMapper 对象映射器 *
* @return 全局异常处理程序 * @param objectMapper 对象映射器
*/ * @return 全局异常处理程序
@Bean */
public GlobalExceptionHandler globalExceptionHandler(ObjectMapper objectMapper) { @Bean
return new GlobalExceptionHandler(objectMapper); public GlobalExceptionHandler globalExceptionHandler(ObjectMapper objectMapper) {
} return new GlobalExceptionHandler(objectMapper);
}
/** /**
* 创建图片验证码处理器 * 创建图片验证码处理器
* @param redisTemplate Redis模板 *
* @return 图片验证码处理器 * @param redisTemplate Redis模板
*/ * @return 图片验证码处理器
@Bean */
public ImageCodeHandler imageCodeHandler(RedisTemplate redisTemplate) { @Bean
return new ImageCodeHandler(redisTemplate); 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 GatewayConfigProperties configProperties;
private final ObjectMapper objectMapper;
private final RedisTemplate<String, Object> redisTemplate; private final RedisTemplate<String, Object> redisTemplate;
/** /**
@ -89,7 +87,7 @@ public class ValidateCodeGatewayFilter extends AbstractGatewayFilterFactory<Obje
CharsetUtil.CHARSET_UTF_8); CharsetUtil.CHARSET_UTF_8);
// 刷新请求跳过直接向下执行 // 刷新请求跳过直接向下执行
if (StrUtil.equals(SecurityConstants.REFRESH_TOKEN, requestBodyMap.get("grant_type"))) { if (StrUtil.equals(SecurityConstants.REFRESH_TOKEN, requestBodyMap.get("grant_type"))) {
return chain.filter(exchange); return chain.filter(exchange.mutate().request(serverHttpRequest).build());
} }
// 根据 randomStr 参数判断验证码是否正常 // 根据 randomStr 参数判断验证码是否正常