JWT+Interceptor实现无状态登录和鉴权 (3)

第二步,将拦截器注册进容器

@Configuration public class InterceptorConfig extends WebMvcConfigurationSupport { @Autowired RequestInterceptor requestInterceptor; // 注册拦截器 protected void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(requestInterceptor) .addPathPatterns("/**") .excludePathPatterns("/user/login/**"); } }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zyyyjz.html