0    课程地址

https://coding.imooc.com/lesson/380.html#mid=28551

 

1    浓缩精华
1.1  浓缩精华

3.2

 

2    个人关注
2.1  个人关注

3.2

 

3    课程内容
3.1  5种filter

pre filters  前置过滤器

routing filters  路由过滤器

post filters  后置过滤器

error filters  错误过滤器

custom filters  自定义过滤器

 

 

 

3.2  自定义过滤器实现的四个方法

filterType:对应Zuul生命周期的四个阶段:

pre、post、route和error公filterOrder:过滤器的优先级,数字越小,优先级越高

shouldFilter:方法返回boolean类型,true时表示是否执行该过滤器的run方法,false则表示不执行意

run:过滤器的过滤逻辑

 

 

 

4    代码演练

 

posted on 2021-01-19 07:19  菜鸟乙  阅读(66)  评论(0编辑  收藏  举报