兼容接口多个"/",比如//system/xxx

This commit is contained in:
zegezy 2024-01-12 10:54:23 +08:00
parent f1af10d727
commit e469b0fda0

View File

@ -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());
}
}