新增资源映射

pull/65/head
fengshuonan 4 years ago
parent 8fb5b620f3
commit 34c0e511b7

@ -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…
Cancel
Save