lqmac 1 year ago
parent 0d18c65ee6
commit 6b906b1b1f
  1. 15
      application/api/controller/User.php

@ -167,10 +167,10 @@ class User extends Api
$extend['pid'] = $user->id; $extend['pid'] = $user->id;
} }
} }
// $ret = Sms::check($mobile, $code, 'register'); $ret = Sms::check($mobile, $code, 'register');
// if (!$ret) { if (!$ret) {
// $this->error(__('Captcha is incorrect')); $this->error(__('Captcha is incorrect'));
// } }
$ret = $this->auth->register($username, $password, $email, $mobile, $extend); $ret = $this->auth->register($username, $password, $email, $mobile, $extend);
if ($ret) { if ($ret) {
$data = ['userinfo' => $this->auth->getUserinfo()]; $data = ['userinfo' => $this->auth->getUserinfo()];
@ -271,6 +271,13 @@ class User extends Api
if (isset($params['avatar']) && $params['avatar']) { if (isset($params['avatar']) && $params['avatar']) {
$upData['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) { if (!$upData) {
$this->success(); $this->success();
} }

Loading…
Cancel
Save