1. 处理多个环境的配置

This commit is contained in:
YunaiV
2021-04-18 21:44:34 +08:00
parent ef7089c1b9
commit 4f70810c35
13 changed files with 104 additions and 263 deletions

View File

@@ -4,7 +4,7 @@ server:
--- #################### 数据库相关配置 ####################
spring:
# 数据源配置项 TODO 监控配置
# 数据源配置项
autoconfigure:
exclude:
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
@@ -48,8 +48,8 @@ spring:
driver-class-name: com.mysql.jdbc.Driver
username: root
password: 123456
slave:
name: ruoyi-vue-slave
slave: # 模拟从库,可根据自己需要修改
name: ruoyi-vue-pro
url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver
username: root
@@ -177,18 +177,10 @@ yudao:
base-path: http://127.0.0.1:${server.port}${yudao.web.api-prefix}/system/file/get/
codegen:
base-package: ${yudao.info.base-package}
db-schemas: ${spring.datasource.name}
db-schemas: ${spring.datasource.dynamic.datasource.master.name}
xss:
enable: false
exclude-urls: # 如下两个 url仅仅是为了演示去掉配置也没关系
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
demo: false # 关闭演示模式