Parcourir la source

添加redis密码

syh il y a 5 ans
Parent
commit
1ed0330060

+ 1 - 1
jeecg-boot-module-system/src/main/resources/application-prod.yml

@@ -118,7 +118,7 @@ spring:
         max-wait: -1ms  #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
         min-idle: 0     #最小等待连接中的数量,设 0 为没有限制
       shutdown-timeout: 100ms
-    password: ''
+    password: foobared
     port: 6379
 #mybatis plus 设置
 mybatis-plus:

+ 3 - 5
module-common/src/main/java/cn/com/ctop/common/module/utils/PropertiesUtils.java

@@ -15,15 +15,13 @@ import java.util.Properties;
  */
 public class PropertiesUtils {
     private static final Logger log = LoggerFactory.getLogger(PropertiesUtils.class);
-    private static Map<String, String> cache = new HashMap<String, String>();
-
+    private static Map<String, String> cache = new HashMap<>();
     public static String getConfig(String key) {
         return getValue("kuaishou_config", key);
     }
-
     public static String getValue(String name, String key) {
         try {
-            String cacheValue = (String) cache.get(name + key);
+            String cacheValue = cache.get(name + key);
             if (cacheValue != null) {
                 return cacheValue;
             }
@@ -49,7 +47,7 @@ public class PropertiesUtils {
                     + name + ".properties");
             props.load(in);
             Iterator<Object> it = props.keySet().iterator();
-            Map<String, String> map = new HashMap<String, String>();
+            Map<String, String> map = new HashMap<>();
             while (it.hasNext()) {
                 String key = it.next().toString();
                 String value = props.getProperty(key);