Pre Merge pull request !384 from 阿超/master

This commit is contained in:
阿超 2022-05-11 01:58:30 +00:00 committed by Gitee
commit 8a85536e62
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 159 additions and 146 deletions

View File

@ -143,4 +143,17 @@ public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationC
final String[] activeProfiles = getActiveProfiles();
return StringUtils.isNotEmpty(activeProfiles) ? activeProfiles[0] : null;
}
/**
* 获取配置文件中的值
*
* @param key 配置文件的key
* @return 当前的配置文件的值
*
*/
public static String getRequiredProperty(String key)
{
return applicationContext.getEnvironment().getRequiredProperty(key);
}
}