作者 lyh

gx

... ... @@ -55,6 +55,8 @@ class UserLoginLogic
}
$projectModel = new Project();
$project_list = $projectModel->list(['id'=>['in',$projectArr]],'id',['id','title']);
//登录选择项目的有效时间
Cache::add('login-project-'.$this->param['mobile'],1,300);
return $this->success($project_list);
}
... ... @@ -66,11 +68,15 @@ class UserLoginLogic
* @time :2023/6/17 16:43
*/
public function projectLogin(){
if(!Cache::get('login-project-'.$this->param['mobile'])){
$this->fail('当前用户选择项目有限时间已过期');
}
//获取项目详情
$info = $this->assembleParam($this->param['mobile'],$this->param['project_id']);
if(isset($info['token']) && !empty($info['token'])){
//清除上一次用户缓存
Cache::pull($info['token']);
Cache::pull('login-project-'.$this->param['mobile']);
}
//生成新token
$token = md5(uniqid().$info['id']);
... ...