This commit is contained in:
不想当厨子的老谭 2025-04-10 16:21:01 +08:00 committed by GitHub
commit 8077329787
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,9 +58,14 @@ public class StrUtil {
Matcher matcher = VARIABLE_PATTERN.matcher(param);
while (matcher.find()) {
String variable = matcher.group(2);
String value = System.getProperty(variable);
if (StringUtils.isBlank(value)) {
value = matcher.group();
String value = matcher.group();
String valueFromEnv = System.getenv(variable);
String valueFromProp = System.getProperty(variable);
if (StringUtils.isNotBlank(valueFromEnv)) {
value = valueFromEnv;
}
if (StringUtils.isNotBlank(valueFromProp)) {
value = valueFromProp;
}
mapping.put(matcher.group(), value);
}