feat: change nacos config
This commit is contained in:
parent
c9ab19d68b
commit
b7a6bf4572
@ -42,11 +42,19 @@ public class TenantConfigManager {
|
|||||||
@Value("${spring.cloud.nacos.config.namespace}")
|
@Value("${spring.cloud.nacos.config.namespace}")
|
||||||
private String namespace;
|
private String namespace;
|
||||||
|
|
||||||
|
@Value("${spring.cloud.nacos.username}")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@Value("${spring.cloud.nacos.password}")
|
||||||
|
private String password;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
properties.put("serverAddr", nacosServerAddr);
|
properties.put("serverAddr", nacosServerAddr);
|
||||||
properties.put("namespace", namespace);
|
properties.put("namespace", namespace);
|
||||||
|
properties.put("username", username);
|
||||||
|
properties.put("password", password);
|
||||||
ConfigService configService = NacosFactory.createConfigService(properties);
|
ConfigService configService = NacosFactory.createConfigService(properties);
|
||||||
|
|
||||||
for (String tenant : tenantProperties.getList()) {
|
for (String tenant : tenantProperties.getList()) {
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: CollaboraOnline
|
name: CollaboraOnline
|
||||||
profiles:
|
|
||||||
active: local
|
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
config:
|
config:
|
||||||
namespace: office
|
namespace: office
|
||||||
group: ATTACHMENT_VIA_GROUP
|
group: ATTACHMENT_VIA_GROUP
|
||||||
|
# server-addr: 127.0.0.1:8848
|
||||||
server-addr: 192.168.3.100:8848
|
server-addr: 192.168.3.100:8848
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
config:
|
config:
|
||||||
import: nacos:application-tenant.yml
|
import: nacos:application-tenant.yml
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user