Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

函数 api 无法使用 Guard #425

Open
mengxiong10 opened this issue Oct 12, 2022 · 1 comment
Open

函数 api 无法使用 Guard #425

mengxiong10 opened this issue Oct 12, 2022 · 1 comment
Assignees

Comments

@mengxiong10
Copy link

使用函数Api 只能把元数据设置到 runner,不能把元数据设置到 FunctionContainer 上里面, , 导致守卫函数里面获取不到元数据

@Guard()
export class AuthGuard implements IGuard<Context> {
  async canActivate(context: Context, FunctionContainer, methodName: string): Promise<boolean> {
     getPropertyMetadata<string[]>('key', FunctionContainer, methodName);
  }
}
@Lxxyx Lxxyx self-assigned this Nov 9, 2022
@Lxxyx
Copy link
Member

Lxxyx commented Nov 9, 2022

关于函数中 Guard 的用法我这边看看

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants