diff --git a/pom.xml b/pom.xml index d3ed8e1d..c515e0d4 100644 --- a/pom.xml +++ b/pom.xml @@ -147,16 +147,18 @@ org.projectlombok lombok + com.github.oshi oshi-core ${oshi.version} + - guns-standalone + guns org.springframework.boot diff --git a/src/main/java/cn/stylefeng/guns/config/web/SpringMvcConfiguration.java b/src/main/java/cn/stylefeng/guns/config/web/SpringMvcConfiguration.java index 661dda4f..8370f2c9 100644 --- a/src/main/java/cn/stylefeng/guns/config/web/SpringMvcConfiguration.java +++ b/src/main/java/cn/stylefeng/guns/config/web/SpringMvcConfiguration.java @@ -11,6 +11,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import javax.annotation.Resource; @@ -31,18 +32,6 @@ public class SpringMvcConfiguration implements WebMvcConfigurer { @Resource private PermissionSecurityInterceptor permissionSecurityInterceptor; - /** - * 配置项目拦截器 - * - * @author fengshuonan - * @date 2020/12/18 9:43 - */ - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(authJwtTokenSecurityInterceptor); - registry.addInterceptor(permissionSecurityInterceptor); - } - /** * 重写系统的默认错误提示 * @@ -79,4 +68,27 @@ public class SpringMvcConfiguration implements WebMvcConfigurer { return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.serializerByType(Long.class, ToStringSerializer.instance).serializerByType(Long.TYPE, ToStringSerializer.instance); } -} \ No newline at end of file + /** + * 配置项目拦截器 + * + * @author fengshuonan + * @date 2020/12/18 9:43 + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authJwtTokenSecurityInterceptor); + registry.addInterceptor(permissionSecurityInterceptor); + } + + /** + * 静态资源映射 + * + * @author fengshuonan + * @date 2021/1/16 21:45 + */ + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/assets/"); + } + +}