作者 lyh

gx

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