1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-29 05:41:37 +08:00

修正验证码关闭后台逻辑

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

View File

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