fix(403 unknow user error!): 新增austin.nacos.username & password配置 添加Properties构造参数

master
topsuder 3 years ago
parent a3baf21bc8
commit a2111e8995

@ -24,6 +24,10 @@ import java.util.Properties;
public class NacosUtils {
@Value("${austin.nacos.server}")
private String nacosServer;
@Value("${austin.nacos.username}")
private String nacosUsername;
@Value("${austin.nacos.password}")
private String nacosPassword;
@Value("${austin.nacos.group}")
private String nacosGroup;
@Value("${austin.nacos.dataId}")
@ -51,6 +55,8 @@ public class NacosUtils {
try {
request.put(PropertyKeyConst.SERVER_ADDR, nacosServer);
request.put(PropertyKeyConst.NAMESPACE, nacosNamespace);
request.put(PropertyKeyConst.USERNAME,nacosUsername);
request.put(PropertyKeyConst.PASSWORD,nacosPassword);
context = NacosFactory.createConfigService(request)
.getConfig(nacosDataId, nacosGroup, 5000);
} catch (NacosException e) {

@ -128,6 +128,8 @@ apollo.bootstrap.namespaces=boss.austin,dynamic-tp-apollo-dtp.yml
##################### nacos #####################
austin.nacos.server=
austin.nacos.username=
austin.nacos.password=
austin.nacos.dataId=austin
austin.nacos.group=DEFAULT_GROUP
austin.nacos.namespace=9537c674-f3a6-4203-b286-ef0c36bfacb2

Loading…
Cancel
Save