使用Fastify preHandler 中间件 Roh*_*han 1 middleware node.js typescript clean-architecture fastify 在访问此路由之前通过中间件对用户进行身份验证。当我tokenController.authUser作为中间件传递时,tokenService内部tokenController是undefined. 但是,当我将此方法作为路由内的函数而不是中间件运行时,它工作得很好。
1. 编写插件 代码参考 https://hub.fastgit.org/duyhotan2000/kong-plugin-auth-redis 感谢原作者的...