mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-02-04 17:45:34 +08:00
微服务重大升级说明(暂时只升级后台3.4.0)
-升级Spring Cloud Alibaba 2021.0.1.0,使用 spring.config.import 方式引入nacos配置 -拆分jeecg-boot-starter出来,使用独立项目维护
This commit is contained in:
@ -24,6 +24,7 @@ import com.alibaba.csp.sentinel.dashboard.datasource.entity.rule.*;
|
||||
import com.alibaba.csp.sentinel.dashboard.rule.nacos.entity.AuthorityRuleCorrectEntity;
|
||||
import com.alibaba.csp.sentinel.dashboard.rule.nacos.entity.ParamFlowRuleCorrectEntity;
|
||||
import com.alibaba.nacos.api.PropertyKeyConst;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -150,8 +151,12 @@ public class SentinelConfig {
|
||||
public ConfigService nacosConfigService() throws Exception {
|
||||
Properties properties=new Properties();
|
||||
properties.put(PropertyKeyConst.SERVER_ADDR,nacosConfigProperties.getServerAddr());
|
||||
properties.put(PropertyKeyConst.USERNAME,nacosConfigProperties.getUsername());
|
||||
properties.put(PropertyKeyConst.PASSWORD,nacosConfigProperties.getPassword());
|
||||
if(StringUtils.isNotBlank(nacosConfigProperties.getUsername())){
|
||||
properties.put(PropertyKeyConst.USERNAME,nacosConfigProperties.getUsername());
|
||||
}
|
||||
if(StringUtils.isNotBlank(nacosConfigProperties.getPassword())){
|
||||
properties.put(PropertyKeyConst.PASSWORD,nacosConfigProperties.getPassword());
|
||||
}
|
||||
return ConfigFactory.createConfigService(properties);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,8 +32,6 @@ logging:
|
||||
nacos:
|
||||
server:
|
||||
ip: @config.server-addr@
|
||||
password: @config.password@
|
||||
username: @config.username@
|
||||
sentinel:
|
||||
dashboard:
|
||||
version: 1.8.2
|
||||
Reference in New Issue
Block a user