@Configuration
public class XxxConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/跟目录后的路径").addResourceLocations(
"file:"+System.getProperty("user.dir")// 根目录
+System.getProperty("file.separator")+"根目录后的路径");
}
}
springboot图片路径映射
最新推荐文章于 2024-07-03 19:13:37 发布