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 7139afa5a64ecf6ad1e6d69f47f3949f067854fd..27749df8313c840a72128bc0b31d7eecb9d2e0fb 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=");