fix: 修复环境变量多个下划线不生效的bug

pull/148/head
xiaojunnuo 2024-08-05 17:47:56 +08:00
parent e8ed97206b
commit 7ec2218c9f
2 changed files with 2 additions and 1 deletions

View File

@ -13,3 +13,4 @@ typeorm:
username: postgres
password: root
database: postgres

View File

@ -12,7 +12,7 @@ function parseEnv(defaultConfig: any) {
continue;
}
keyName = keyName.replace('certd_', '');
const configKey = keyName.replace('_', '.');
const configKey = keyName.replaceAll('_', '.');
const oldValue = _.get(defaultConfig, configKey);
let value: any = process.env[key];
if (typeof oldValue === 'boolean') {