修复全局变量与模板中的转移不一致问题

This commit is contained in:
makejava 2022-07-06 15:29:59 +08:00
parent 6ffdb6fad0
commit 8f93ef44a3
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ public final class TemplateUtils {
for (GlobalConfig globalConfig : globalConfigs) {
String name = globalConfig.getName();
// 正则被替换字符转义处理
String value = globalConfig.getValue().replace("$", "\\$");
String value = globalConfig.getValue().replace("\\", "\\\\").replace("$", "\\$");
// 将不带{}的变量加上{}
template = template.replaceAll("\\$!?" + name + "(\\W)", "\\$!{" + name + "}$1");