不继承WebMvcConfigurationSupport,改为实现WebMvcConfigurer接口

@Configuration
public class WebInterceptor  implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserHandlerInterceptor()).
                addPathPatterns("/**")
                .excludePathPatterns(
                        "/login"
                );
    }
}

 

相关文章:

  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-04
  • 2021-09-01
  • 2022-12-23
  • 2022-01-16
  • 2021-10-18
  • 2022-12-23
  • 2021-08-28
相关资源
相似解决方案