From a2111e8995fa38794b0c9c5be3b2e9a687e3b5a4 Mon Sep 17 00:00:00 2001 From: topsuder Date: Tue, 22 Nov 2022 14:03:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(403=20unknow=20user=20error!):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9Eaustin.nacos.username=20&=20password=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0Properties=E6=9E=84=E9=80=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/java3y/austin/support/utils/NacosUtils.java | 6 ++++++ austin-web/src/main/resources/application.properties | 2 ++ 2 files changed, 8 insertions(+) diff --git a/austin-support/src/main/java/com/java3y/austin/support/utils/NacosUtils.java b/austin-support/src/main/java/com/java3y/austin/support/utils/NacosUtils.java index dc6a54a..10f7707 100644 --- a/austin-support/src/main/java/com/java3y/austin/support/utils/NacosUtils.java +++ b/austin-support/src/main/java/com/java3y/austin/support/utils/NacosUtils.java @@ -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) { diff --git a/austin-web/src/main/resources/application.properties b/austin-web/src/main/resources/application.properties index 2de4250..9df52e3 100644 --- a/austin-web/src/main/resources/application.properties +++ b/austin-web/src/main/resources/application.properties @@ -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