diff --git a/extend/catcher/command/install/DisableModuleCommand.php b/extend/catcher/command/install/DisableModuleCommand.php index 98b8d57..7dd91a6 100644 --- a/extend/catcher/command/install/DisableModuleCommand.php +++ b/extend/catcher/command/install/DisableModuleCommand.php @@ -10,6 +10,7 @@ // +---------------------------------------------------------------------- namespace catcher\command\install; +use catchAdmin\permissions\model\Permissions; use catcher\CatchAdmin; use think\console\Command; use think\console\Input; @@ -30,11 +31,13 @@ class DisableModuleCommand extends Command { $module = $input->getArgument('module'); - //dd($module, 123); if (empty(CatchAdmin::getModuleInfo(CatchAdmin::directory() .$module))) { $output->error("module [$module] not exist"); } else { CatchAdmin::disableModule($module); + Permissions::destroy(function ($query) use ($module){ + $query->where('module', trim($module)); + }); $output->info("module [$module] disabled"); } } diff --git a/extend/catcher/command/install/EnableModuleCommand.php b/extend/catcher/command/install/EnableModuleCommand.php index 4df2841..2a14dc2 100644 --- a/extend/catcher/command/install/EnableModuleCommand.php +++ b/extend/catcher/command/install/EnableModuleCommand.php @@ -10,6 +10,7 @@ // +---------------------------------------------------------------------- namespace catcher\command\install; +use catchAdmin\permissions\model\Permissions; use catcher\CatchAdmin; use think\console\Command; use think\console\Input; @@ -33,6 +34,7 @@ class EnableModuleCommand extends Command $output->error("module [$module] not exist"); } else { CatchAdmin::enableModule($module); + app(Permissions::class)->restore(['module' => trim($module)]); $output->info("module [$module] enabled"); } }