fix/login-verification-email-template #26
@@ -294,6 +294,18 @@ export class VerificationService {
|
||||
return `verification_hourly:${type}:${identifier}:${date}:${hour}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除验证码冷却时间
|
||||
*
|
||||
* @param identifier 标识符
|
||||
* @param type 验证码类型
|
||||
*/
|
||||
async clearCooldown(identifier: string, type: VerificationCodeType): Promise<void> {
|
||||
const cooldownKey = this.buildCooldownKey(identifier, type);
|
||||
await this.redis.del(cooldownKey);
|
||||
this.logger.log(`验证码冷却时间已清除: ${identifier} (${type})`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理过期的验证码(可选的定时任务)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user