xiongzhu 2 lat temu
rodzic
commit
f8b87a2e12
2 zmienionych plików z 8 dodań i 5 usunięć
  1. 1 1
      src/aliyun/aliyun.service.ts
  2. 7 4
      src/sms/dto/sms.dto.ts

+ 1 - 1
src/aliyun/aliyun.service.ts

@@ -20,7 +20,7 @@ export class AliyunService {
     ) {}
 
     public async sendCode(data: SendCodeDto) {
-        await this.authSig(data.sessionId, data.sig, data.token)
+        //await this.authSig(data.sessionId, data.sig, data.token)
         if (!/^1[3-9]\d{9}$/.test(data.phone)) {
             throw new InternalServerErrorException('手机号码格式不正确')
         }

+ 7 - 4
src/sms/dto/sms.dto.ts

@@ -1,4 +1,4 @@
-import { IsString, MaxLength } from 'class-validator'
+import { IsOptional, IsString, MaxLength } from 'class-validator'
 
 export class SendCodeDto {
     @IsString()
@@ -6,13 +6,16 @@ export class SendCodeDto {
     readonly phone: string
 
     @IsString()
-    readonly sessionId: string
+    @IsOptional()
+    readonly sessionId?: string
 
     @IsString()
-    readonly sig: string
+    @IsOptional()
+    readonly sig?: string
 
     @IsString()
-    readonly token: string
+    @IsOptional()
+    readonly token?: string
 }
 
 export class VerifyCodeDto {