1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-24 12:05:39 +08:00

修正验证码关闭后台逻辑

This commit is contained in:
koogua 2022-03-23 09:52:55 +08:00
parent 6f679e74e9
commit c77e1801ac
3 changed files with 24 additions and 6 deletions

View File

@ -53,9 +53,17 @@ class Account extends Service
$validator->checkIfAllowLogin($user);
$captcha = $this->getSettings('captcha');
/**
* 验证码是一次性的,放到最后检查,减少第三方调用
*/
if ($captcha['enabled'] == 1) {
$validator = new CaptchaValidator();
$validator->checkCode($post['ticket'], $post['rand']);
}
$this->auth->saveAuthInfo($user);

View File

@ -23,9 +23,14 @@ class MailCode extends LogicService
$post['email'] = $validator->checkEmail($post['email']);
$captcha = $this->getSettings('captcha');
if ($captcha['enabled'] == 1) {
$validator = new CaptchaValidator();
$validator->checkCode($post['ticket'], $post['rand']);
}
$service = new MailVerifyService();

View File

@ -23,9 +23,14 @@ class SmsCode extends LogicService
$post['phone'] = $validator->checkPhone($post['phone']);
$captcha = $this->getSettings('captcha');
if ($captcha['enabled'] == 1) {
$validator = new CaptchaValidator();
$validator->checkCode($post['ticket'], $post['rand']);
}
$service = new SmsVerifyService();