mirror of
http://124.126.16.154:8888/singularity/hyperf-admin.git
synced 2026-01-15 07:35:09 +08:00
Update SystemController.php
This commit is contained in:
@@ -34,13 +34,11 @@ class SystemController extends AdminAbstractController
|
||||
|
||||
$router_ids = $this->permission_service->getRoleMenuIds($role_ids);
|
||||
|
||||
foreach ($config['system_module'] as $module_key => $module_value) {
|
||||
$routers = make(Menu::class)->tree([
|
||||
'module' => $module_value['name'],
|
||||
'id' => $router_ids,
|
||||
]);
|
||||
$modules = array_unique($this->permission_service->getModules($router_ids));
|
||||
|
||||
if(empty($routers)) unset($config['system_module'][$module_key]);
|
||||
foreach ($config['system_module'] as $module_key => $module_value) {
|
||||
if(!in_array($module_value['name'], $modules))
|
||||
unset($config['system_module'][$module_key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user