手机验证码注册
This commit is contained in:
parent
0fe66b9c21
commit
8c6838fbf2
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue