fixed:模块列表排除超级管理员

This commit is contained in:
JaguarJack 2020-10-12 14:15:41 +08:00
parent bcb96cd3c4
commit 753f6b9dcf

View File

@ -7,6 +7,7 @@ use catcher\CatchResponse;
use catcher\CatchAdmin;
use catcher\library\InstallCatchModule;
use catcher\library\InstallLocalModule;
use catcher\Utils;
use think\response\Json;
class Module extends CatchController
@ -30,11 +31,13 @@ class Module extends CatchController
array_multisort($orders, SORT_DESC, $modules);
if (!Utils::isSuperAdmin()) {
foreach ($modules as $k => $module) {
if (!in_array($module['alias'], $hasModules)) {
unset($modules[$k]);
}
}
}
return CatchResponse::success(array_values($modules));
}