mirror of https://gitee.com/stylefeng/guns
新增资源映射
parent
8fb5b620f3
commit
34c0e511b7
4
pom.xml
4
pom.xml
|
@ -147,16 +147,18 @@
|
|||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--硬件信息获取-->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
<version>${oshi.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>guns-standalone</finalName>
|
||||
<finalName>guns</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 配置项目拦截器
|
||||
*
|
||||
* @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/");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue