放弃短信验证了
This commit is contained in:
@@ -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 { }
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user