作者 lyh

gx

@@ -7,6 +7,7 @@ use App\Exceptions\AsideGlobalException; @@ -7,6 +7,7 @@ use App\Exceptions\AsideGlobalException;
7 use App\Exceptions\BsideGlobalException; 7 use App\Exceptions\BsideGlobalException;
8 use App\Helper\Common; 8 use App\Helper\Common;
9 use App\Http\Logic\Aside\Project\ProjectLogic; 9 use App\Http\Logic\Aside\Project\ProjectLogic;
  10 +use App\Models\Project\Project;
10 use App\Models\SmsLog; 11 use App\Models\SmsLog;
11 use App\Models\User\ProjectRole as ProjectRoleModel; 12 use App\Models\User\ProjectRole as ProjectRoleModel;
12 use App\Models\User\User; 13 use App\Models\User\User;
@@ -85,7 +86,8 @@ class UserLoginLogic @@ -85,7 +86,8 @@ class UserLoginLogic
85 $info['manager_id'] = $data['manager_id'];//代表自动登录写入日志 86 $info['manager_id'] = $data['manager_id'];//代表自动登录写入日志
86 Cache::add($token,$info,3600); 87 Cache::add($token,$info,3600);
87 } 88 }
88 - Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),'project_id'=>$info['project_id'], 'type'=>1 ,'remark' => '自动登录,操作管理员为:'.$data['manager_id']]); 89 + Common::set_user_login(['user_id'=>$info['id'],'ip'=>request()->ip(),
  90 + 'project_id'=>$info['project_id'], 'type'=>1 ,'remark' => '自动登录,操作管理员为:'.$data['manager_id']]);
89 return $info; 91 return $info;
90 } 92 }
91 93
@@ -144,9 +146,10 @@ class UserLoginLogic @@ -144,9 +146,10 @@ class UserLoginLogic
144 $this->fail('当前用户角色被禁用',Code::USER_REGISTER_ERROE); 146 $this->fail('当前用户角色被禁用',Code::USER_REGISTER_ERROE);
145 } 147 }
146 } 148 }
  149 + //获取项目详情
147 $project = (new ProjectLogic())->getProjectInfo($info['project_id']); 150 $project = (new ProjectLogic())->getProjectInfo($info['project_id']);
148 $info['company'] = $project['company'] ?? ''; 151 $info['company'] = $project['company'] ?? '';
149 - $info['plan'] = $project['deploy_build']['plan'][0] ?? ''; 152 + $info['plan'] = Project::planMap()[$project['deploy_build']['plan']];
150 $info['domain'] = !empty($project['deploy_optimize']['domain']) ? 153 $info['domain'] = !empty($project['deploy_optimize']['domain']) ?
151 $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? ''); 154 $project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? '');
152 return $this->success($info); 155 return $this->success($info);
@@ -24,12 +24,13 @@ class VisitLogic extends BaseLogic @@ -24,12 +24,13 @@ class VisitLogic extends BaseLogic
24 24
25 public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20) 25 public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20)
26 { 26 {
27 - 27 + $map['domain'] = $this->user['domain'];
28 return Logic::getList($map, $sort, ['id', 'url', 'referrer_url', 'device_port', 'country', 'ip', 'depth', 'created_at'], $limit); 28 return Logic::getList($map, $sort, ['id', 'url', 'referrer_url', 'device_port', 'country', 'ip', 'depth', 'created_at'], $limit);
29 } 29 }
30 30
31 public function getItemList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20){ 31 public function getItemList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20){
32 $this->model = new VisitItem(); 32 $this->model = new VisitItem();
  33 + $map['domain'] = $this->user['domain'];
33 return Logic::getList($map, $sort, ['url', 'created_at'], 0); 34 return Logic::getList($map, $sort, ['url', 'created_at'], 0);
34 } 35 }
35 36