From 0d0cc6eeb68bbc43cd4ed5e9d412a6da5040a0aa Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Fri, 13 Dec 2019 17:25:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catchAdmin/CatchAdminService.php | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/catchAdmin/CatchAdminService.php b/catchAdmin/CatchAdminService.php index 9df52e1..de12131 100644 --- a/catchAdmin/CatchAdminService.php +++ b/catchAdmin/CatchAdminService.php @@ -6,11 +6,13 @@ use catchAdmin\permissions\OperateLogListener; use catchAdmin\permissions\PermissionsMiddleware; use catchAdmin\system\event\LoginLogEvent; use catchAdmin\system\event\OperateLogEvent; +use catcher\command\BackupCommand; use catcher\command\InstallCommand; use catcher\command\MigrateRunCommand; use catcher\command\ModelGeneratorCommand; use catcher\command\ModuleCacheCommand; use catcher\command\SeedRunCommand; +use catcher\event\LoadModuleRoutes; use catcher\validates\Sometimes; use think\facade\Validate; use think\Service; @@ -24,20 +26,30 @@ class CatchAdminService extends Service */ public function boot() { - $this->commands([ - InstallCommand::class, - ModuleCacheCommand::class, - MigrateRunCommand::class, - ModelGeneratorCommand::class, - SeedRunCommand::class - ]); + $this->registerCommands(); $this->registerValidates(); $this->registerMiddleWares(); $this->registerEvents(); $this->registerListeners(); } + /** + * + * @time 2019年12月13日 + * @return void + */ + protected function registerCommands(): void + { + $this->commands([ + InstallCommand::class, + ModuleCacheCommand::class, + MigrateRunCommand::class, + ModelGeneratorCommand::class, + SeedRunCommand::class, + BackupCommand::class, + ]); + } /** * * @time 2019年12月07日 @@ -98,6 +110,9 @@ class CatchAdminService extends Service 'operateLog' => [ OperateLogListener::class, ], + 'RouteLoaded' => [ + LoadModuleRoutes::class + ] ]); }