From 2eebead81cf2e3acc5524b8bee0d9f2b8e85612d Mon Sep 17 00:00:00 2001 From: louis <869322496@qq.com> Date: Wed, 17 Apr 2024 10:24:09 +0800 Subject: [PATCH] feat: default domain --- src/common/decorators/domain.decorator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/decorators/domain.decorator.ts b/src/common/decorators/domain.decorator.ts index bcd02c2..1ecb045 100644 --- a/src/common/decorators/domain.decorator.ts +++ b/src/common/decorators/domain.decorator.ts @@ -7,7 +7,7 @@ import type { FastifyRequest } from 'fastify'; */ export const Domain = createParamDecorator((_, context: ExecutionContext) => { const request = context.switchToHttp().getRequest(); - return request.headers['sk-domain']; + return request.headers['sk-domain'] ?? 1; }); export type SkDomain = number;