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); Matcher matcher = VARIABLE_PATTERN.matcher(param);
while (matcher.find()) { while (matcher.find()) {
String variable = matcher.group(2); String variable = matcher.group(2);
String value = System.getProperty(variable); String value = matcher.group();
if (StringUtils.isBlank(value)) { String valueFromEnv = System.getenv(variable);
value = matcher.group(); String valueFromProp = System.getProperty(variable);
if (StringUtils.isNotBlank(valueFromEnv)) {
value = valueFromEnv;
}
if (StringUtils.isNotBlank(valueFromProp)) {
value = valueFromProp;
} }
mapping.put(matcher.group(), value); mapping.put(matcher.group(), value);
} }