🐛 Fixing a bug. 网关读取客户端配置序列化规则

This commit is contained in:
lbw committed 2023-11-29 15:03:04 +08:00
1 parent 30f9f31513
commit 2a4546becd
1 file changed
+1 -3
@@ -39,7 +39,6 @@ import org.springframework.cloud.gateway.filter.factory.rewrite.CachedBodyOutput
import org.springframework.cloud.gateway.support.BodyInserterContext;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.codec.HttpMessageReader;
@@ -79,7 +78,7 @@ public class PasswordDecoderFilter extends AbstractGatewayFilterFactory {
private static final String KEY_ALGORITHM = "AES";
private final RedisTemplate redisTemplate;
private final RedisTemplate<String, String> redisTemplate;
private final GatewayConfigProperties gatewayConfig;
@@ -138,7 +137,6 @@ public class PasswordDecoderFilter extends AbstractGatewayFilterFactory {
String key = String.format("%s:%s:%s", StrUtil.isBlank(tenantId) ? CommonConstants.TENANT_ID_1 : tenantId,
CacheConstants.CLIENT_FLAG, clientId);
redisTemplate.setKeySerializer(new StringRedisSerializer());
Object val = redisTemplate.opsForValue().get(key);
// 当配置不存在时,默认需要解密