|
...
|
...
|
@@ -3,9 +3,11 @@ |
|
|
|
namespace App\Http\Controllers\Bside\BCom;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Helper\Arr;
|
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Http\Controllers\Bside\BaseController;
|
|
|
|
use App\Http\Logic\Bside\User\UserLogic;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\User\ProjectMenu as ProjectMenuModel;
|
|
|
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
|
...
|
...
|
@@ -26,18 +28,10 @@ class ComController extends BaseController |
|
|
|
//根据当前登录用户角色返回用户菜单列表
|
|
|
|
$projectMenuModel = new ProjectMenuModel();
|
|
|
|
if($this->user['role_id'] != 0){
|
|
|
|
$projectRoleModel = new ProjectRoleModel();
|
|
|
|
$info = $projectRoleModel->read(['id'=>$this->user['role_id']]);
|
|
|
|
$info['role_menu'] = trim($info['role_menu'],',');
|
|
|
|
$this->map = [
|
|
|
|
'status'=>0,
|
|
|
|
'is_role'=>0,
|
|
|
|
'id'=>['in',explode(',',$info['role_menu'])]
|
|
|
|
];
|
|
|
|
$this->map = $this->getRoleMenuList();
|
|
|
|
}else{
|
|
|
|
$this->map = [
|
|
|
|
'status'=>0,
|
|
|
|
];
|
|
|
|
$this->map['status'] = 0;
|
|
|
|
$this->map['id'] = ['!=',11];
|
|
|
|
}
|
|
|
|
$lists = $projectMenuModel->list($this->map,'sort');
|
|
|
|
$menu = array();
|
|
...
|
...
|
@@ -51,6 +45,7 @@ class ComController extends BaseController |
|
|
|
$this->response('当前用户菜单列表',Code::SUCCESS,$menu);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :获取当前项目详情
|
|
|
|
* @author :liyuhang
|
|
...
|
...
|
@@ -65,6 +60,51 @@ class ComController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :非超级管理员菜单列表
|
|
|
|
* @name :getRoleMenuLis
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/6 11:47
|
|
|
|
*/
|
|
|
|
public function getRoleMenuList(){
|
|
|
|
$code = $this->getIsHome();
|
|
|
|
$projectRoleModel = new ProjectRoleModel();
|
|
|
|
$info = $projectRoleModel->read(['id'=>$this->user['role_id']]);
|
|
|
|
if($code != 0){
|
|
|
|
$info['role_menu'] = trim(str_replace(',11,','',','.$info['role_menu'].','),',');
|
|
|
|
}
|
|
|
|
$this->map = [
|
|
|
|
'status'=>0,
|
|
|
|
'is_role'=>0,
|
|
|
|
'id'=>['in',explode(',',$info['role_menu'])]
|
|
|
|
];
|
|
|
|
return $this->map;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :查看是否显示网站装饰
|
|
|
|
* @name :getIsHome
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/6 11:30
|
|
|
|
*/
|
|
|
|
public function getIsHome(){
|
|
|
|
$deployBuild = new DeployBuild();
|
|
|
|
$info = $deployBuild->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
if(empty($info['configuration'])){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
$configuration = Arr::s2a($info['configuration']);
|
|
|
|
if(!isset($configuration['is_home'])){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if(($configuration['is_home'] == 0)){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :登录用户编辑资料/修改密码
|
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
...
|
...
|
|