添加验证码日志

This commit is contained in:
2025-05-07 18:57:12 +08:00
parent c16d5c8ef4
commit 5719dc1bb5

View File

@@ -1,9 +1,11 @@
import { Injectable } from '@nestjs/common'; import { Injectable, Logger } from '@nestjs/common';
import { NotificationService } from 'src/notification/notification.service'; import { NotificationService } from 'src/notification/notification.service';
@Injectable() @Injectable()
export class VerificationService { export class VerificationService {
private readonly logger = new Logger(VerificationService.name);
constructor( constructor(
private readonly notificationService: NotificationService, private readonly notificationService: NotificationService,
) { } ) { }
@@ -23,6 +25,8 @@ export class VerificationService {
// 生成验证码 // 生成验证码
const code = this.generateCode(); const code = this.generateCode();
this.logger.log(`Phone[${phone}] code: ${code}`);
// 发送验证码 // 发送验证码
// await this.notificationService.sendSMS(phone, type, code); // await this.notificationService.sendSMS(phone, type, code);
// 存储验证码 // 存储验证码
@@ -36,6 +40,7 @@ export class VerificationService {
// 生成验证码 // 生成验证码
const code = this.generateCode(); const code = this.generateCode();
this.logger.log(`Email[${email}] code: ${code}`);
// 发送验证码 // 发送验证码
// TODO // TODO