初始化

缺陷:主题配色需要优化整体的同风格
This commit is contained in:
2026-08-14 23:21:21 +08:00
parent 6e2769c528
commit bcf54c2727
152 changed files with 13521 additions and 141 deletions

View File

@@ -17,6 +17,7 @@ class RoleController extends BaseController
parent::__construct();
$this->insertField = ['name', 'value', 'desc'];
$this->updateField = ['id', 'name', 'value', 'desc'];
$this->notRequest = ['status', 'color', 'pid'];
$this->service = RoleService::getInstance();
}
@@ -51,4 +52,52 @@ class RoleController extends BaseController
$this->service->saveRoleMenu($roleId, $menuIds)
);
}
/**
* 接口授权树:按控制器分组的全部可授权接口
* @Method GET
*/
public function endpointTree(): JsonResponse
{
return jok($this->service->endpointTree(), '获取成功');
}
/**
* 角色已授权的接口 id
* @Method GET
* @throws Exception
*/
public function getEndpointIdsByRoleIds(): JsonResponse
{
return jok($this->service->getEndpointIdsByRoleId(request()->get('role_id')));
}
/**
* 保存角色接口授权
* @Method POST
* @throws Exception
*/
public function saveRoleEndpoint(): JsonResponse
{
$this->insertField = ['role_id'];
$this->checkRequiredFields(request()->post());
return jok(
$this->service->saveRoleEndpoint(
(int) request()->post('role_id'),
(array) request()->post('endpoint_id', [])
)
);
}
/**
* 启用 / 停用角色
* @Method POST
* @throws Exception
*/
public function status(): JsonResponse
{
$this->insertField = ['id', 'status'];
$params = $this->checkRequiredFields(request()->post());
return jok($this->service->status($params['id'], $params['status']), '操作成功');
}
}