更新client打包配置,优化http路由逻辑

This commit is contained in:
aoshiguchen
2022-10-12 17:19:59 +08:00
parent 0dd37dd661
commit b0e594a82b
3 changed files with 40 additions and 7 deletions
@@ -234,6 +234,7 @@ public class DefaultHttpRouter implements HttpRouter {
if (null != staticResource && CollectionUtil.notEmpty(staticResource.getLocations())) {
for (String location : staticResource.getLocations()) {
String path = location + httpRouteParam.getUrl();
path = path.replaceAll("//", "/");
if (path.endsWith("/")) {
path += "index.html";
}
+36 -6
View File
@@ -21,24 +21,54 @@
</dependency>
</dependencies>
<!-- <build>-->
<!-- <finalName>${artifactId}</finalName>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <version>2.1.3.RELEASE</version>-->
<!-- <configuration>-->
<!-- <mainClass>fun.asgc.neutrino.proxy.client.ProxyClient</mainClass>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>repackage</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
<build>
<finalName>${artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.1.3.RELEASE</version>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<mainClass>fun.asgc.neutrino.proxy.client.ProxyClient</mainClass>
<appendAssemblyId>false</appendAssemblyId>
<finalName>${artifactId}</finalName>
<archive>
<manifest>
<!--这里指定要运行的main类-->
<mainClass>fun.asgc.neutrino.proxy.client.ProxyClient</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>repackage</goal>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -41,7 +41,9 @@ public class VisitLogInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpRequestWrapper requestParser, HttpResponseWrapper responseWrapper, String route, Method targetMethod) throws Exception {
SystemContextHolder.getContext().setReceiveTime(new Date());
if (null != SystemContextHolder.getContext()) {
SystemContextHolder.getContext().setReceiveTime(new Date());
}
return true;
}