作者 lyh

gx

@@ -37,26 +37,10 @@ class BaseLogic extends Logic @@ -37,26 +37,10 @@ class BaseLogic extends Logic
37 $this->request = request(); 37 $this->request = request();
38 $this->requestAll = request()->all(); 38 $this->requestAll = request()->all();
39 $this->user = Cache::get(request()->header('token')); 39 $this->user = Cache::get(request()->header('token'));
40 - $this->project = $this->getProjectInfo($this->user['project_id']); 40 + $this->project = Cache::get('user-'.$this->user['project_id']);
41 } 41 }
42 42
43 /** 43 /**
44 - * @remark :获取项目数据详情  
45 - * @name :getProjectInfo  
46 - * @author :lyh  
47 - * @method :post  
48 - * @time :2023/8/17 10:20  
49 - */  
50 - public function getProjectInfo($id){  
51 - $projectModel = new Project();  
52 - $info = $projectModel->with('payment')->with('deploy_build')  
53 - ->with('deploy_optimize')->with('online_check')->where(['id'=>$id])->first();  
54 - if($info['extend_type'] != 0){  
55 - $info['type'] = $info['extend_type'];  
56 - }  
57 - return $this->success($info);  
58 - }  
59 - /**  
60 * 列表 44 * 列表
61 * @param array $map 45 * @param array $map
62 * @param array $sort 46 * @param array $sort
@@ -150,15 +150,32 @@ class UserLoginLogic @@ -150,15 +150,32 @@ class UserLoginLogic
150 } 150 }
151 } 151 }
152 //获取项目详情 152 //获取项目详情
153 - $project = (new ProjectLogic())->getProjectInfo($info['project_id']); 153 + $project = $this->getProjectInfo($info['project_id']);
154 $info['company'] = $project['company'] ?? ''; 154 $info['company'] = $project['company'] ?? '';
155 $info['plan'] = Project::planMap()[$project['deploy_build']['plan']]; 155 $info['plan'] = Project::planMap()[$project['deploy_build']['plan']];
156 $info['domain'] = !empty($project['deploy_optimize']['domain']) ? 156 $info['domain'] = !empty($project['deploy_optimize']['domain']) ?
157 $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? ''); 157 $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? '');
  158 + //保存项目缓存
  159 + Cache::add('user-'.$project,$project);
158 return $this->success($info); 160 return $this->success($info);
159 } 161 }
160 162
161 - 163 + /**
  164 + * @remark :获取项目数据详情
  165 + * @name :getProjectInfo
  166 + * @author :lyh
  167 + * @method :post
  168 + * @time :2023/8/17 10:20
  169 + */
  170 + public function getProjectInfo($id){
  171 + $projectModel = new Project();
  172 + $info = $projectModel->with('payment')->with('deploy_build')
  173 + ->with('deploy_optimize')->with('online_check')->where(['id'=>$id])->first();
  174 + if($info['extend_type'] != 0){
  175 + $info['type'] = $info['extend_type'];
  176 + }
  177 + return $this->success($info);
  178 + }
162 /** 179 /**
163 * @notes: 请简要描述方法功能 180 * @notes: 请简要描述方法功能
164 * @param array $data 181 * @param array $data