放弃短信验证了

This commit is contained in:
2025-05-07 17:21:49 +08:00
parent 8039a3571d
commit 9570fb4524
7 changed files with 369 additions and 4 deletions

View File

@@ -1,10 +1,12 @@
import { Module } from '@nestjs/common';
import { VerificationController } from './verification.controller';
import { VerificationService } from './verification.service';
import { NotificationModule } from 'src/notification/notification.module';
@Module({
controllers: [VerificationController],
providers: [VerificationService],
exports: [VerificationService],
imports: [NotificationModule],
})
export class VerificationModule {}
export class VerificationModule { }

View File

@@ -1,8 +1,13 @@
import { Injectable } from '@nestjs/common';
import { NotificationService } from 'src/notification/notification.service';
@Injectable()
export class VerificationService {
constructor(
private readonly notificationService: NotificationService,
) { }
private pool: Map<string, {
code: string;
createdAt: number;
@@ -19,8 +24,7 @@ export class VerificationService {
// 生成验证码
const code = this.generateCode();
// 发送验证码
// TODO
// await this.notificationService.sendSMS(phone, type, code);
// 存储验证码
this.saveCode(key, code);
}