'']); //分享楼书的接口需要传token //店面id ,分享人id , 楼盘id , 户型id , 案例id , 在施工地id $arr = ['rootId'=>0,'employeeId'=>0,'buildingId'=>0,'housetypeId'=>0,'cateId'=>0,'constructionId'=>0]; if ($param['token']) { $aec = new Aec(config('app.aec_key'), config('app.aec_iv')); $value = $aec->decrypt($param['token']); if (!$value || count(explode('#',$value)) != 6) { json(['code'=>1,'msg'=>'token错误','data'=>[]])->send(); exit; } $str = explode('#',$value); $arr['rootId'] = $str[0]; $arr['employeeId'] = $str[1]; $arr['buildingId'] = $str[2]; $arr['housetypeId'] = $str[3]; $arr['caseId'] = $str[4]; $arr['constructionId'] = $str[5]; } $this->params = $arr; $this->rootId = $arr['rootId']; $this->employeId = $arr['employeeId']; //部分接口 需要登陆人员信息 $employee = ['employeeId'=>0,'rootId'=>0,'uid'=>0,'str'=>'']; $jwt = $request->header('Authorization'); if($jwt){ $jwt = str_replace('bearer ', '', $jwt); $aec = new Aec(config('app.aec_key'), config('app.aec_iv')); try { JWT::$leeway = 60; //token的弹性有效时间 $decoded = JWT::decode($jwt, config('app.jwt_key'), ['HS256']); $arr = (array) $decoded; $aes = new Aes(config('app.jwt_key')); $queryData = $aes->decrypt($arr['data']); parse_str($queryData, $token); $employee['employeeId'] = $token['employee_id']; $employee['rootId'] = $token['root_id']; $employee['uid'] = $token['uid']; $employee['str'] = $aec->encrypt($token['root_id'].'#'.$token['employee_id']); } catch (Exception $e) { } } $this->employee = $employee; } }