refactor(auth): 重构认证服务配置管理

This commit is contained in:
黄斌峰
2026-08-07 19:05:15 +08:00
parent 1e1a817081
commit f692d8e275
5 changed files with 29 additions and 46 deletions
@@ -43,6 +43,8 @@ import org.springframework.session.data.redis.config.annotation.web.http.EnableR
public class AuthApplication {
public static void main(String[] args) {
// 禁用框架注入的nacos import配置、config、discovery 配置
BladeApplication.disableNacosLaunchConfig();
BladeApplication.run(AppConstant.APPLICATION_AUTH_NAME, AuthApplication.class, args);
}
@@ -1,15 +0,0 @@
#服务器端口
server:
port: 8100
#数据源配置
spring:
datasource:
url: ${blade.datasource.dev.url}
username: ${blade.datasource.dev.username}
password: ${blade.datasource.dev.password}
#第三方登陆
social:
enabled: true
domain: http://127.0.0.1:2888
@@ -1,15 +0,0 @@
#服务器端口
server:
port: 8100
#数据源配置
spring:
datasource:
url: ${blade.datasource.prod.url}
username: ${blade.datasource.prod.username}
password: ${blade.datasource.prod.password}
#第三方登陆
social:
enabled: true
domain: http://127.0.0.1:2888
@@ -1,15 +0,0 @@
#服务器端口
server:
port: 8100
#数据源配置
spring:
datasource:
url: ${blade.datasource.test.url}
username: ${blade.datasource.test.username}
password: ${blade.datasource.test.password}
#第三方登陆
social:
enabled: true
domain: http://127.0.0.1:2888
+27 -1
View File
@@ -1,6 +1,30 @@
# 在使用Spring默认数据源Hikari的情况下配置以下配置项
#服务器端口
server:
port: 8100
spring:
application:
name: blade-auth
config:
import:
- nacos:blade.yaml?group=DEFAULT_GROUP&refreshEnabled=true
- nacos:blade-${spring.profiles.active}.yaml?group=DEFAULT_GROUP&refreshEnabled=true
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml?group=DEFAULT_GROUP&refreshEnabled=true
cloud:
nacos:
username: ${NACOS_USERNAME:nacos}
password: ${NACOS_PASSWORD:nacos}
server-addr: ${NACOS_HOST:127.0.0.1:8848}
discovery:
namespace: ${NACOS_NAMESPACE:${spring.profiles.active}}
config:
# 文件后缀名
file-extension: yaml
namespace: ${NACOS_NAMESPACE:${spring.profiles.active}}
datasource:
url: ${blade.datasource.${spring.profiles.active}.url}
username: ${blade.datasource.${spring.profiles.active}.username}
password: ${blade.datasource.${spring.profiles.active}.password}
# 在使用Spring默认数据源Hikari的情况下配置以下配置项
hikari:
# 自动提交从池中返回的连接
auto-commit: true
@@ -42,6 +66,8 @@ swagger:
#第三方登陆
social:
enabled: true
domain: http://127.0.0.1:2888
oauth:
GITHUB:
client-id: 233************