diff --git a/README.md b/README.md index 7bc3c9ba3..163b2707e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ #### 项目简介 -[youlai-mall](https://gitee.com/youlaitech/youlai-mall) 是基于Spring Boot 2.5.0、Spring Cloud 2020 & Alibaba 2021、vue、element-ui、uni-app快速构建的一套全栈开源商城项目。 +[youlai-mall](https://gitee.com/youlaitech/youlai-mall) 是基于Spring Boot 2.5、Spring Cloud 2020 & Alibaba 2021、vue、element-ui、uni-app快速构建的一套全栈开源商城项目。 项目采用微服务、前后端分离开发模式;汇集全栈主流的技术栈; 涉及 [后端微服务](https://gitee.com/youlaitech/youlai-mall) 、 [前端管理](https://gitee.com/youlaitech/youlai-mall-admin) 、 [微信小程序](https://gitee.com/youlaitech/youlai-mall-weapp) 和 [APP应用](https://gitee.com/youlaitech/youlai-mall-weapp) 等多端的开发。 diff --git a/youlai-common/common-redis/src/main/java/com/youlai/common/redis/redisson/RedissonConfig.java b/youlai-common/common-redis/src/main/java/com/youlai/common/redis/redisson/RedissonConfig.java index 7b17ea4db..13bf1d763 100644 --- a/youlai-common/common-redis/src/main/java/com/youlai/common/redis/redisson/RedissonConfig.java +++ b/youlai-common/common-redis/src/main/java/com/youlai/common/redis/redisson/RedissonConfig.java @@ -1,8 +1,10 @@ package com.youlai.common.redis.redisson; +import cn.hutool.core.util.StrUtil; import org.redisson.Redisson; import org.redisson.api.RedissonClient; import org.redisson.config.Config; +import org.redisson.config.SingleServerConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -21,11 +23,13 @@ public class RedissonConfig { return null; } Config config = new Config(); - config.useSingleServer() - //可以用"rediss://"来启用SSL连接 - .setAddress(properties.getServerAddress() + ":" + properties.getPort()) - .setDatabase(properties.getDatabase()) - .setPassword(properties.getPassword()); + SingleServerConfig singleServerConfig = config.useSingleServer(); + singleServerConfig.setAddress(properties.getServerAddress() + ":" + properties.getPort()); + singleServerConfig.setDatabase(properties.getDatabase()); + String password = properties.getPassword(); + if (StrUtil.isNotBlank(password)) { + singleServerConfig.setPassword(password); + } return Redisson.create(config); }