|
@@ -69,16 +69,17 @@ class UserLoginLogic |
|
@@ -69,16 +69,17 @@ class UserLoginLogic |
|
69
|
$info = $this->model->read(['mobile'=>$this->param['mobile'],'password'=>$password,'status'=>$this::USER_STATUS],
|
69
|
$info = $this->model->read(['mobile'=>$this->param['mobile'],'password'=>$password,'status'=>$this::USER_STATUS],
|
|
70
|
['id','mobile','role_id','token','name','project_id']);
|
70
|
['id','mobile','role_id','token','name','project_id']);
|
|
71
|
if($info === false){
|
71
|
if($info === false){
|
|
72
|
- //账号密码没通过时,验证验证码
|
|
|
|
73
|
- $info = $this->model->read(['mobile'=>$this->param['mobile'],'status'=>$this::USER_STATUS],
|
|
|
|
74
|
- ['id','mobile','role_id','token','name','project_id']);
|
|
|
|
75
|
- if($info === false){
|
|
|
|
76
|
- $this->fail('账号密码错误',Code::USER_REGISTER_ERROE);
|
|
|
|
77
|
- }
|
|
|
|
78
|
- //验证验证码是否准备
|
72
|
+ //账号密码没通过时,验证验证码验证验证码是否准备
|
|
79
|
$last_sms = SmsLog::getLastLog($this->param['mobile'], SmsLog::TYPE_LOGIN);
|
73
|
$last_sms = SmsLog::getLastLog($this->param['mobile'], SmsLog::TYPE_LOGIN);
|
|
80
|
if($this->param['password'] != $last_sms->code){
|
74
|
if($this->param['password'] != $last_sms->code){
|
|
81
|
- $this->fail('账号密码错误',Code::USER_REGISTER_ERROE);
|
75
|
+ $this->fail('账号密码错误/验证码错误',Code::USER_REGISTER_ERROE);
|
|
|
|
76
|
+ }
|
|
|
|
77
|
+ $info = $this->model->read(['mobile'=>$this->param['mobile']],['id','mobile','role_id','token','name','project_id']);
|
|
|
|
78
|
+ if($info === false){
|
|
|
|
79
|
+ $this->fail('当前用户不存在',Code::USER_REGISTER_ERROE);
|
|
|
|
80
|
+ }
|
|
|
|
81
|
+ if($info['status'] != self::USER_STATUS){
|
|
|
|
82
|
+ $this->fail('当前用户被禁用',Code::USER_REGISTER_ERROE);
|
|
82
|
}
|
83
|
}
|
|
83
|
}
|
84
|
}
|
|
84
|
return $this->success($info);
|
85
|
return $this->success($info);
|