import { CanActivate, ExecutionContext } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; import { ConfigService } from '../../config'; import { RequestContextService } from '../common/request-context.service'; /** * @description * 权限守卫: * * 1. 检查请求中是否存在有效的会话令牌,如果找到则将当前的 User 实体附加到请求中。 * 2. 强制目标处理程序(解析器、字段解析器或路由)所需的任何权限,如果这些权限不存在,则抛出一个 ForbiddenError */ export declare class AuthGuard implements CanActivate { private reflector; private configService; private requestContextService; strategy: any; constructor(reflector: Reflector, configService: ConfigService, requestContextService: RequestContextService); canActivate(context: ExecutionContext): Promise; private getSession; /** * 当这个守卫在FieldResolver上被调用时返回true,即不是顶级 Query 或 Mutation 解析器。 */ private isFieldResolver; }