!17 配置文件增加环境变量的支持,有环境变量则使用,没有则使用默认

Merge pull request !17 from suanyun/master
pull/495/head
Elune 2020-09-14 10:59:30 +08:00 committed by Gitee
commit 029a932ff9
4 changed files with 11 additions and 10 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
*.iml
*/target/*
*/*.iml
/.gradle/

View File

@ -4,9 +4,9 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://localhost:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: root
password: 123456
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:eladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: ${DB_USER:root}
password: ${DB_PWD:123456}
# 初始连接数
initial-size: 5
# 最小连接数

View File

@ -4,9 +4,9 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://localhost:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: root
password: 123456
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:eladmin}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: ${DB_USER:root}
password: ${DB_PWD:123456}
# 初始连接数
initial-size: 5
# 最小连接数

View File

@ -23,10 +23,10 @@ spring:
redis:
#数据库索引
database: 0
host: 127.0.0.1
port: 6379
password:
database: ${REDIS_DB:0}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
#连接超时时间
timeout: 5000