如何解决使用非全局拦截器类修改请求参数
lb4 interceptor
生成非全局拦截器。
我需要使用拦截器来更改方法的参数/参数。因此,拦截器将充当此方法的中间件
// I'm going t
@get('go/user')
async hello(@param.query.string('token') token: string){
const userId = this.someService.findUser(token)
....
}
// I need to inject userId to the hello method using this interceptor instead above method
@intercept(AuthenticateInterceptor.BINDING_KEY)
@get('go/user')
async hello(@param.query.string('token') token: string){....}
可以实施吗?还有其他方法(例如方法级中间件)来达到上述效果吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。