diff --git a/doc/docs/files/10089_自定义校验token.md b/doc/docs/files/10089_自定义校验token.md index 365e77c2..07152ef6 100644 --- a/doc/docs/files/10089_自定义校验token.md +++ b/doc/docs/files/10089_自定义校验token.md @@ -34,10 +34,11 @@ public StoryResult token(StoryParam story) { `TokenValidator`是一个函数式接口,可以直接使用Lambda表达式,示例代码如下: ```java -public class ZuulConfig extends AlipayZuulConfiguration { +@Component +public class MyConfig { - @Override - protected void doAfter() { + @PostConstruct + public void after() { ApiConfig.getInstance().setTokenValidator(apiParam -> { // 获取客户端传递过来的token String token = apiParam.fetchAccessToken();