正在显示
1 个修改的文件
包含
12 行增加
和
6 行删除
| @@ -46,12 +46,18 @@ class UserLoginLogic | @@ -46,12 +46,18 @@ 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 | - $password = base64_encode(md5($this->param['password'])); | ||
| 50 | - $list = $this->model->list(['mobile'=>$this->param['mobile'], | ||
| 51 | - 'password'=>$password,'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']); | ||
| 52 | - if(empty($list)){ | 49 | + if($info['is_password'] == $this->model::STATUS_ZERO){//查看是否开启了密码登录:默认未开启 |
| 53 | //验证code | 50 | //验证code |
| 54 | $list = $this->verifyCode($this->param['mobile'],$this->param['password']); | 51 | $list = $this->verifyCode($this->param['mobile'],$this->param['password']); |
| 52 | + }else{ | ||
| 53 | + //先验证密码是否正确,在验证验证码 | ||
| 54 | + $password = base64_encode(md5($this->param['password'])); | ||
| 55 | + $list = $this->model->list(['mobile'=>$this->param['mobile'], | ||
| 56 | + 'password'=>$password,'status'=>$this->model::STATUS_ZERO],'id',['id','project_id']); | ||
| 57 | + if(empty($list)){ | ||
| 58 | + //默认只能使用验证码登录 | ||
| 59 | + $list = $this->verifyCode($this->param['mobile'],$this->param['password']); | ||
| 60 | + } | ||
| 55 | } | 61 | } |
| 56 | } | 62 | } |
| 57 | //获取所有项目的项目id | 63 | //获取所有项目的项目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); |
-
请 注册 或 登录 后发表评论