springboot 拦截器的使用

1、自定义拦截器 实现HandlerInterceptor接口、重写拦截器方法

2、配置拦截器,通过@Configuration自定义配置类 ,实现WebMvcConfigurer接口 , 重写添加拦截器的方法addInterceptors()

 

3、WebMvcConfigurer的方法

 

猜你喜欢

转载自blog.csdn.net/mobin518/article/details/87892734