spring boot—mybatis—pagehelper,分页拦截器和自定义的数据权限拦截器的顺序自定义问题?
1个回答
展开全部
@Override
public void addInterceptors(InterceptorRegistry registry) {
//1.加入的顺序就是拦截器执行的顺序,
//2.按顺序执行所有拦截器的preHandle
//3.所有的preHandle 执行完再执行全部postHandle
registry.addInterceptor(studentInterceptor).addPathPatterns("/**");
registry.addInterceptor(myInterceptor).addPathPatterns("/**");
registry.addInterceptor(userInterceptor).addPathPatterns("/**");
}
public void addInterceptors(InterceptorRegistry registry) {
//1.加入的顺序就是拦截器执行的顺序,
//2.按顺序执行所有拦截器的preHandle
//3.所有的preHandle 执行完再执行全部postHandle
registry.addInterceptor(studentInterceptor).addPathPatterns("/**");
registry.addInterceptor(myInterceptor).addPathPatterns("/**");
registry.addInterceptor(userInterceptor).addPathPatterns("/**");
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询