小编Vu *_*ham的帖子

在 NestJS 中,如何在自定义方法装饰器中获取执行上下文或请求实例?

我有一个像这样的自定义方法装饰器。

export function CustomDecorator() {

    return applyDecorators(
        UseGuards(JwtAuthGuard)
    );
}
Run Code Online (Sandbox Code Playgroud)

在自定义装饰器中,我想获取请求标头但不确定如何获取请求实例?

decorator nestjs

2
推荐指数
1
解决办法
2085
查看次数

标签 统计

decorator ×1

nestjs ×1