From e469b0fda0e09a20cd4aec9f9cd90ad495104459 Mon Sep 17 00:00:00 2001 From: zegezy <1098696801@qq.com> Date: Fri, 12 Jan 2024 10:54:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=8E=A5=E5=8F=A3=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA"/"=EF=BC=8C=E6=AF=94=E5=A6=82//system/xxx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../magicboot/configuration/WebConfiguration.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/ssssssss/magicboot/configuration/WebConfiguration.java b/src/main/java/org/ssssssss/magicboot/configuration/WebConfiguration.java index d257b64..9f6530a 100644 --- a/src/main/java/org/ssssssss/magicboot/configuration/WebConfiguration.java +++ b/src/main/java/org/ssssssss/magicboot/configuration/WebConfiguration.java @@ -1,8 +1,10 @@ package org.ssssssss.magicboot.configuration; import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.util.UrlPathHelper; import org.ssssssss.magicboot.model.Global; @Configuration @@ -13,4 +15,10 @@ public class WebConfiguration implements WebMvcConfigurer { registry.addResourceHandler(Global.USER_FILES_BASE_URL + "**").addResourceLocations("file:" + Global.getDir() + Global.USER_FILES_BASE_URL); } + // 兼容接口多个"/",比如//system/xxx + @Override + public void configurePathMatch(PathMatchConfigurer configurer) { + configurer.setUrlPathHelper(new UrlPathHelper()); + } + }