From 6b906b1b1f59693062b636ebef60019bdc5ee8ef Mon Sep 17 00:00:00 2001 From: lqmac Date: Thu, 2 Nov 2023 15:04:45 +0800 Subject: [PATCH] 1 --- application/api/controller/User.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 6c3abe8..a98b4ec 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -167,10 +167,10 @@ class User extends Api $extend['pid'] = $user->id; } } - // $ret = Sms::check($mobile, $code, 'register'); - // if (!$ret) { - // $this->error(__('Captcha is incorrect')); - // } + $ret = Sms::check($mobile, $code, 'register'); + if (!$ret) { + $this->error(__('Captcha is incorrect')); + } $ret = $this->auth->register($username, $password, $email, $mobile, $extend); if ($ret) { $data = ['userinfo' => $this->auth->getUserinfo()]; @@ -271,6 +271,13 @@ class User extends Api if (isset($params['avatar']) && $params['avatar']) { $upData['avatar'] = $params['avatar']; } + if (isset($params['bank_realname']) || $params['wechat_image'] || $params['alipay_image']) { + $user = $this->auth->getUserinfo(); + $ret = Sms::check($user['mobile'], $params['code'], 'notice'); + if (!$ret) { + $this->error(__('Captcha is incorrect')); + } + } if (!$upData) { $this->success(); }