|
@@ -82,22 +82,22 @@ class User extends Api
|
|
|
$this->error(__('Captcha is incorrect'));
|
|
|
}
|
|
|
$user = \app\common\model\User::getByMobile($mobile);
|
|
|
- if (!$user) {
|
|
|
- $this->error('用户尚未注册');
|
|
|
- }
|
|
|
- if ($user['status'] != 1) {
|
|
|
- $this->error(__('Account is locked'));
|
|
|
- }
|
|
|
-// if ($user) {
|
|
|
-// if ($user->status != 'normal') {
|
|
|
-// $this->error(__('Account is locked'));
|
|
|
-// }
|
|
|
-// //如果已经有账号则直接登录
|
|
|
-// $ret = $this->auth->direct($user->id);
|
|
|
-// } else {
|
|
|
-// $ret = $this->auth->register($mobile, Random::alnum(), '', $mobile, []);
|
|
|
+// if (!$user) {
|
|
|
+// $this->error('用户尚未注册');
|
|
|
// }
|
|
|
- $ret = $this->auth->direct($user->id);
|
|
|
+// if ($user['status'] != 1) {
|
|
|
+// $this->error(__('Account is locked'));
|
|
|
+// }
|
|
|
+ if ($user) {
|
|
|
+ if ($user->status != 1) {
|
|
|
+ $this->error(__('Account is locked'));
|
|
|
+ }
|
|
|
+ //如果已经有账号则直接登录
|
|
|
+ $ret = $this->auth->direct($user->id);
|
|
|
+ } else {
|
|
|
+ $ret = $this->auth->register($mobile, Random::alnum(), '', $mobile, []);
|
|
|
+ }
|
|
|
+// $ret = $this->auth->direct($user->id);
|
|
|
if ($ret) {
|
|
|
Sms::flush($mobile, 'mobilelogin');
|
|
|
$data = ['userinfo' => $this->auth->getUserinfo()];
|