From 9eb35e5f1e891d2932c55f983f5f9f4454fac6ac Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 23 Feb 2026 22:10:28 -0800 Subject: [PATCH] =?UTF-8?q?fix(auth):=20=E4=BF=AE=E5=A4=8D=20TypeScript=20?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF=20=E2=80=94=20RegisterDto.?= =?UTF-8?q?password=20=E5=8F=AF=E9=80=89=20+=20Aliyun=20import=20=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- .../src/application/services/auth.service.ts | 2 +- .../src/infrastructure/sms/aliyun-sms.provider.ts | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/backend/services/auth-service/src/application/services/auth.service.ts b/backend/services/auth-service/src/application/services/auth.service.ts index 361c35a..44f8a08 100644 --- a/backend/services/auth-service/src/application/services/auth.service.ts +++ b/backend/services/auth-service/src/application/services/auth.service.ts @@ -20,7 +20,7 @@ import { EventPublisherService } from './event-publisher.service'; export interface RegisterDto { phone: string; smsCode: string; - password: string; + password?: string; nickname?: string; } diff --git a/backend/services/auth-service/src/infrastructure/sms/aliyun-sms.provider.ts b/backend/services/auth-service/src/infrastructure/sms/aliyun-sms.provider.ts index 4298b2a..8d87bc3 100644 --- a/backend/services/auth-service/src/infrastructure/sms/aliyun-sms.provider.ts +++ b/backend/services/auth-service/src/infrastructure/sms/aliyun-sms.provider.ts @@ -70,11 +70,14 @@ export class AliyunSmsProvider implements ISmsProvider { private async getClient() { if (this.client) return this.client; - // 动态导入 (仅生产环境需要) - const { default: Dysmsapi20170525 } = await import( - '@alicloud/dysmsapi20170525' - ); - const { Config } = await import('@alicloud/openapi-client'); + // 动态导入 (仅生产环境需要, 开发环境不安装这些包) + // eslint-disable-next-line @typescript-eslint/no-var-requires + const { default: Dysmsapi20170525 } = await (import( + /* webpackIgnore: true */ '@alicloud/dysmsapi20170525' + ) as any); + const { Config } = await (import( + /* webpackIgnore: true */ '@alicloud/openapi-client' + ) as any); const config = new Config({ accessKeyId: process.env.ALIYUN_ACCESS_KEY_ID,