|
@@ -46,14 +46,20 @@ class UserLoginLogic |
|
@@ -46,14 +46,20 @@ class UserLoginLogic |
|
46
|
$list = $this->model->list(['mobile'=>$this->param['mobile'],
|
46
|
$list = $this->model->list(['mobile'=>$this->param['mobile'],
|
|
47
|
'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']);
|
47
|
'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']);
|
|
48
|
}else{
|
48
|
}else{
|
|
|
|
49
|
+ if($info['is_password'] == $this->model::STATUS_ZERO){//查看是否开启了密码登录:默认未开启
|
|
|
|
50
|
+ //验证code
|
|
|
|
51
|
+ $list = $this->verifyCode($this->param['mobile'],$this->param['password']);
|
|
|
|
52
|
+ }else{
|
|
|
|
53
|
+ //先验证密码是否正确,在验证验证码
|
|
49
|
$password = base64_encode(md5($this->param['password']));
|
54
|
$password = base64_encode(md5($this->param['password']));
|
|
50
|
$list = $this->model->list(['mobile'=>$this->param['mobile'],
|
55
|
$list = $this->model->list(['mobile'=>$this->param['mobile'],
|
|
51
|
'password'=>$password,'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']);
|
56
|
'password'=>$password,'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']);
|
|
52
|
if(empty($list)){
|
57
|
if(empty($list)){
|
|
53
|
- //验证code
|
58
|
+ //默认只能使用验证码登录
|
|
54
|
$list = $this->verifyCode($this->param['mobile'],$this->param['password']);
|
59
|
$list = $this->verifyCode($this->param['mobile'],$this->param['password']);
|
|
55
|
}
|
60
|
}
|
|
56
|
}
|
61
|
}
|
|
|
|
62
|
+ }
|
|
57
|
//获取所有项目的项目id
|
63
|
//获取所有项目的项目id
|
|
58
|
foreach ($list as $v){
|
64
|
foreach ($list as $v){
|
|
59
|
$projectArr[] = $v['project_id'];
|
65
|
$projectArr[] = $v['project_id'];
|
|
@@ -143,10 +149,10 @@ class UserLoginLogic |
|
@@ -143,10 +149,10 @@ class UserLoginLogic |
|
143
|
$smsInfo = $smsModel->formatQuery(['mobile'=>$mobile,'type'=>$smsModel::TYPE_LOGIN])->orderBy('id','desc')->first();
|
149
|
$smsInfo = $smsModel->formatQuery(['mobile'=>$mobile,'type'=>$smsModel::TYPE_LOGIN])->orderBy('id','desc')->first();
|
|
144
|
if(!empty($smsInfo)){
|
150
|
if(!empty($smsInfo)){
|
|
145
|
if(($password != $smsInfo['code']) || ($smsInfo['created_at'] < date('Y-m-d H:i:s',time() - 300))){
|
151
|
if(($password != $smsInfo['code']) || ($smsInfo['created_at'] < date('Y-m-d H:i:s',time() - 300))){
|
|
146
|
- $this->fail('账号密码错误/验证码错误');
|
152
|
+ $this->fail('验证码错误,如需账号密码登录,请联系管理员开启');
|
|
147
|
}
|
153
|
}
|
|
148
|
}else{
|
154
|
}else{
|
|
149
|
- $this->fail('账号密码错误/验证码错误');
|
155
|
+ $this->fail('验证码错误,如需账号密码登录,请联系管理员开启');
|
|
150
|
}
|
156
|
}
|
|
151
|
$list = $this->model->list(['mobile'=>$this->param['mobile'],'status'=>$this->model::STATUS_ZERO],['id','project_id']);
|
157
|
$list = $this->model->list(['mobile'=>$this->param['mobile'],'status'=>$this->model::STATUS_ZERO],['id','project_id']);
|
|
152
|
return $this->success($list);
|
158
|
return $this->success($list);
|