Commit f212dcb5 by tangzy

修改redisPassword错误

parent fd9f0dee
...@@ -4,7 +4,6 @@ import log.Log; ...@@ -4,7 +4,6 @@ import log.Log;
import log.LogFactory; import log.LogFactory;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisPassword;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
...@@ -15,11 +14,10 @@ import javax.annotation.Resource; ...@@ -15,11 +14,10 @@ import javax.annotation.Resource;
@Configuration @Configuration
public class RedisListenerConfig { public class RedisListenerConfig {
@Resource
private RedisBalanceProperties redisProperties;
@Resource @Resource
private StringRedisSerializer keySerializer; private StringRedisSerializer keySerializer;
@Resource @Resource
private GenericJackson2JsonRedisSerializer valueSerializer; private GenericJackson2JsonRedisSerializer valueSerializer;
...@@ -67,10 +65,4 @@ public class RedisListenerConfig { ...@@ -67,10 +65,4 @@ public class RedisListenerConfig {
return redisTemplate; return redisTemplate;
} }
@Bean("redisPassword")
public RedisPassword redisPassword()
{
return RedisPassword.of(redisProperties.getPassWord1());
}
} }
...@@ -17,8 +17,7 @@ public class RedisStandaloneConfigurationExt1 extends RedisStandaloneConfigurati ...@@ -17,8 +17,7 @@ public class RedisStandaloneConfigurationExt1 extends RedisStandaloneConfigurati
@Resource @Resource
private RedisStandaloneConfiguration redisStandaloneConfiguration1; private RedisStandaloneConfiguration redisStandaloneConfiguration1;
@Resource
private RedisPassword redisPassword;
@Resource @Resource
private RedisBalanceProperties redisProperties; private RedisBalanceProperties redisProperties;
...@@ -44,7 +43,7 @@ public class RedisStandaloneConfigurationExt1 extends RedisStandaloneConfigurati ...@@ -44,7 +43,7 @@ public class RedisStandaloneConfigurationExt1 extends RedisStandaloneConfigurati
{ {
return RedisPassword.none(); return RedisPassword.none();
} }
String miwen = String.valueOf(redisPassword.get()); String miwen = String.valueOf(redisProperties.getPassWord1());
try { try {
String mingwen = new String(new BASE64Decoder().decodeBuffer(miwen), "utf-8"); String mingwen = new String(new BASE64Decoder().decodeBuffer(miwen), "utf-8");
return RedisPassword.of(mingwen); return RedisPassword.of(mingwen);
......
...@@ -17,8 +17,7 @@ public class RedisStandaloneConfigurationExt2 extends RedisStandaloneConfigurati ...@@ -17,8 +17,7 @@ public class RedisStandaloneConfigurationExt2 extends RedisStandaloneConfigurati
@Resource @Resource
private RedisStandaloneConfiguration redisStandaloneConfiguration2; private RedisStandaloneConfiguration redisStandaloneConfiguration2;
@Resource
private RedisPassword redisPassword;
@Resource @Resource
private RedisBalanceProperties redisProperties; private RedisBalanceProperties redisProperties;
...@@ -46,7 +45,7 @@ public class RedisStandaloneConfigurationExt2 extends RedisStandaloneConfigurati ...@@ -46,7 +45,7 @@ public class RedisStandaloneConfigurationExt2 extends RedisStandaloneConfigurati
return RedisPassword.none(); return RedisPassword.none();
} }
String miwen = String.valueOf(redisPassword.get()); String miwen = String.valueOf(redisProperties.getPassWord1());
try { try {
String mingwen = new String(new BASE64Decoder().decodeBuffer(miwen), "utf-8"); String mingwen = new String(new BASE64Decoder().decodeBuffer(miwen), "utf-8");
return RedisPassword.of(mingwen); return RedisPassword.of(mingwen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment