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(); }