From 8c6838fbf29ad55b17d29f66f8788a929dfbc2eb Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Tue, 2 Jan 2024 18:18:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/LoginLogic.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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,