From 95ef76d6440a5363c0b7981b1333f82f9345322d Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Thu, 07 Jul 2022 15:15:56 +0800
Subject: [PATCH] fix template upload

---
 src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java b/src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java
index b11eae9..38c8fcc 100644
--- a/src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java
+++ b/src/main/java/com/xcong/farmer/cms/core/node/AttrNode.java
@@ -2,6 +2,7 @@
 
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.xcong.farmer.cms.core.handler.DataParserHandler;
 import com.xcong.farmer.cms.core.tag.TagsEnum;
@@ -77,6 +78,14 @@
         }
 
         this.element.empty();
+
+        // 设置img的链接访问
+        if ("img".equals(this.element.tagName())) {
+            String src = this.element.attr("src");
+            if (StrUtil.isNotBlank(STATIC_URL)) {
+                this.element.attr("src", STATIC_URL + src);
+            }
+        }
         Attributes attributes = this.element.attributes();
         if (attributes.isEmpty()) {
             return;

--
Gitblit v1.9.1