作者 李宇航

合并分支 'master-server' 到 'master'

Master server



查看合并请求 !1299
@@ -206,7 +206,6 @@ class CopyProject extends Command @@ -206,7 +206,6 @@ class CopyProject extends Command
206 } 206 }
207 return true; 207 return true;
208 } 208 }
209 -  
210 //复制数据库 209 //复制数据库
211 public function copyMysql($project_id,$new_project_id){ 210 public function copyMysql($project_id,$new_project_id){
212 //切换数据库配置 211 //切换数据库配置
@@ -267,7 +266,6 @@ class CopyProject extends Command @@ -267,7 +266,6 @@ class CopyProject extends Command
267 } 266 }
268 return true; 267 return true;
269 } 268 }
270 -  
271 /** 269 /**
272 * @param $message 270 * @param $message
273 * @return bool 271 * @return bool
@@ -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);