From 4af8ead28f1a64a08cf22e41c284587ca9f71ba8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 24 Mar 2024 16:32:15 +0800 Subject: [PATCH] 1 --- addons/shopro/controller/Index.php | 9 +++++++-- addons/shopro/controller/user/WalletLog.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/shopro/controller/Index.php b/addons/shopro/controller/Index.php index 321d835..09423c3 100755 --- a/addons/shopro/controller/Index.php +++ b/addons/shopro/controller/Index.php @@ -4,6 +4,7 @@ namespace addons\shopro\controller; use addons\shopro\controller\traits\Util; use addons\shopro\library\easywechatPlus\WechatMiniProgramShop; +use addons\shopro\service\user\UserAuth; use app\admin\model\shopro\decorate\Decorate; use app\admin\model\shopro\decorate\Page; use app\common\library\Sms as Smslib; @@ -171,8 +172,12 @@ class Index extends Common //被占用 $this->error(__('手机号已经被占用')); } elseif (in_array($event, ['changepwd', 'resetpwd', 'mobilelogin']) && !$userinfo) { - //未注册 - $this->error(__('手机号未注册')); + //未注册 注册手机号 + $userAuth = new UserAuth(); + $auth = $userAuth->register(['mobile' => $mobile]); + set_token_in_header($auth->getToken()); +// set_token_in_header($auth->getToken()); +// $this->error(__('手机号未注册')); } } if (!Hook::get('sms_send')) { diff --git a/addons/shopro/controller/user/WalletLog.php b/addons/shopro/controller/user/WalletLog.php index fd16aef..468cc51 100755 --- a/addons/shopro/controller/user/WalletLog.php +++ b/addons/shopro/controller/user/WalletLog.php @@ -71,7 +71,7 @@ class WalletLog extends Common $user = auth_user(); $user_id = $user->id; - if (!Sms::check($params['exchange_phone'], $params['code'], 'mobilelogin')) { + if (!Sms::check($params['exchange_phone'], $params['code'], 'score')) { $this->error('验证码不正确'); } $exchange_user = UserModel::getByMobile($params['exchange_phone']);