|
@@ -80,9 +80,9 @@ class User extends Api
|
|
|
if (!$mobile || !$captcha) {
|
|
|
$this->error(__('Invalid parameters'));
|
|
|
}
|
|
|
- if (!Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
+ /*if (!Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
$this->error(__('Mobile is incorrect'));
|
|
|
- }
|
|
|
+ }*/
|
|
|
if (!Sms::check($mobile, $captcha, 'mobilelogin')) {
|
|
|
$this->error(__('Captcha is incorrect'));
|
|
|
}
|
|
@@ -137,9 +137,9 @@ class User extends Api
|
|
|
if ($email && !Validate::is($email, "email")) {
|
|
|
$this->error(__('Email is incorrect'));
|
|
|
}
|
|
|
- if ($mobile && !Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
- $this->error(__('Mobile is incorrect'));
|
|
|
- }
|
|
|
+ //if ($mobile && !Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
+ // $this->error(__('Mobile is incorrect'));
|
|
|
+ //}
|
|
|
$ret = Sms::check($mobile, $code, 'register');
|
|
|
if (!$ret) {
|
|
|
$this->error(__('Captcha is incorrect'));
|
|
@@ -508,9 +508,9 @@ class User extends Api
|
|
|
if (!$oldcaptcha || !$mobile || !$captcha) {
|
|
|
$this->error(__('Invalid parameters'));
|
|
|
}
|
|
|
- if (!Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
+ /*if (!Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
$this->error(__('Mobile is incorrect'));
|
|
|
- }
|
|
|
+ }*/
|
|
|
if($user->mobile == $mobile){
|
|
|
$this->error('新手机号不能与旧手机号相同');
|
|
|
}
|
|
@@ -554,9 +554,9 @@ class User extends Api
|
|
|
if (!$mobile || !$captcha) {
|
|
|
$this->error(__('Invalid parameters'));
|
|
|
}
|
|
|
- if (!Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
+ /*if (!Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
$this->error(__('Mobile is incorrect'));
|
|
|
- }
|
|
|
+ }*/
|
|
|
if (\app\common\model\User::where('mobile', $mobile)->find()) {
|
|
|
$this->error('该手机号已被其他用户绑定');
|
|
|
}
|
|
@@ -625,9 +625,9 @@ class User extends Api
|
|
|
$this->error(__('Invalid parameters'));
|
|
|
}
|
|
|
if ($type == 'mobile') {
|
|
|
- if (!Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
+ /*if (!Validate::regex($mobile, "^1\d{10}$")) {
|
|
|
$this->error(__('Mobile is incorrect'));
|
|
|
- }
|
|
|
+ }*/
|
|
|
$user = \app\common\model\User::getByMobile($mobile);
|
|
|
if (!$user) {
|
|
|
$this->error(__('User not found'));
|