feat:添加验证码调试功能

- 在验证码服务中添加debugCodeInfo方法
- 在业务层添加debugVerificationCode调试接口
- 新增/auth/debug-verification-code调试端点
- 支持查看验证码详细状态信息(TTL、尝试次数等)
- 便于开发和生产环境问题排查
This commit is contained in:
moyin
2025-12-17 21:23:22 +08:00
parent de3b108503
commit 34a9e727b4
3 changed files with 59 additions and 1 deletions

View File

@@ -567,4 +567,16 @@ export class LoginCoreService {
const phoneRegex = /^(\+\d{1,3}[- ]?)?\d{10,11}$/;
return phoneRegex.test(str.replace(/\s/g, ''));
}
}
/**
* 调试验证码信息
*
* @param email 邮箱地址
* @returns 调试信息
*/
async debugVerificationCode(email: string): Promise<any> {
return await this.verificationService.debugCodeInfo(
email,
VerificationCodeType.EMAIL_VERIFICATION
);
}
}