@Configuration
public class MyWebConfigurer extends WebMvcConfigurationSupport {
@Bean
LoginInterceptor loginInterceptor() {
return new LoginInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
//配置登录拦截器
(loginInterceptor())
.addPathPatterns("/**")
.excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "//**", "//**");
}
@Override
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
("").addResourceLocations("classpath:/META-INF/resources/");
("").addResourceLocations("classpath:/META-INF/resources/");
("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
}