From 24e150674337183d660d26927bdb6cea2185f8e6 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Wed, 1 Jul 2020 15:47:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=AF=E7=94=A8/=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=A8=A1=E5=9D=97=E5=88=A0=E9=99=A4=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/command/install/DisableModuleCommand.php | 5 ++++- extend/catcher/command/install/EnableModuleCommand.php | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) 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"); } }