diff --git a/src/main/java/com/sjhy/plugin/tool/TemplateUtils.java b/src/main/java/com/sjhy/plugin/tool/TemplateUtils.java index 9b0702c..6151000 100644 --- a/src/main/java/com/sjhy/plugin/tool/TemplateUtils.java +++ b/src/main/java/com/sjhy/plugin/tool/TemplateUtils.java @@ -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");