From fe496a1dc32e8f56aa2c0046767e8fd153901900 Mon Sep 17 00:00:00 2001 From: tanghc Date: Mon, 8 Jun 2020 14:20:41 +0800 Subject: [PATCH] doc --- doc/docs/files/10089_自定义校验token.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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();