diff --git a/app/api/logic/LoginLogic.php b/app/api/logic/LoginLogic.php index 9cc01c8a..743300d1 100644 --- a/app/api/logic/LoginLogic.php +++ b/app/api/logic/LoginLogic.php @@ -14,6 +14,7 @@ namespace app\api\logic; +use app\api\validate\LoginAccountValidate; use app\common\cache\WebScanLoginCache; use app\common\logic\BaseLogic; use app\common\model\auth\Admin; @@ -53,7 +54,13 @@ class LoginLogic extends BaseLogic $passwordSalt = Config::get('project.unique_identification'); $password = create_password($params['password'], $passwordSalt); $avatar = ConfigService::get('default_image', 'user_avatar'); - + // 校验短信验证码 + $verifyCode = $params['verify_code']; + $params['account'] = intval($params['mobile']); + if((new LoginAccountValidate())->checkCode($verifyCode, [], $params) === true) { + self::setError('验证码错误'); + return false; + } Db::transaction(function () use($userSn,$password,$avatar,$params) { $user = User::create([ 'sn' => $userSn,