mirror of https://gitee.com/makejava/EasyCode.git
修复全局变量与模板中的转移不一致问题
This commit is contained in:
parent
6ffdb6fad0
commit
8f93ef44a3
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue