From fe6a88c19ef0c205757978a98bc7a0bb2c40a55a Mon Sep 17 00:00:00 2001 From: Nickyin <1181476441@qq.com> Date: Sun, 26 Jun 2022 17:09:30 +0800 Subject: [PATCH] =?UTF-8?q?I5E5KE(bugfix):=E4=BF=AE=E5=A4=8Dwebroot?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/gitee/kooder/server/VelocityTool.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gateway/src/main/java/com/gitee/kooder/server/VelocityTool.java b/gateway/src/main/java/com/gitee/kooder/server/VelocityTool.java index 7139afa..27749df 100644 --- a/gateway/src/main/java/com/gitee/kooder/server/VelocityTool.java +++ b/gateway/src/main/java/com/gitee/kooder/server/VelocityTool.java @@ -39,6 +39,8 @@ import java.util.List; */ public class VelocityTool { + private static final String WEB_ROOT_PATH_KEY = "webroot"; + private RoutingContext context; public VelocityTool(RoutingContext context) { @@ -57,7 +59,9 @@ public class VelocityTool { public String static_with_timestamp(String uri) { StringBuffer url = new StringBuffer(); url.append(uri); - Path path = KooderConfig.getPath("gateway/src/main/webapp/" + uri); + String webRootPath = + KooderConfig.getHttpProperties().getProperty(WEB_ROOT_PATH_KEY, "gateway/src/main/webapp"); + Path path = KooderConfig.getPath(webRootPath + "/" + uri); if(Files.exists(path)) { try { url.append("?timestamp="); -- Gitee