优化服务发现

This commit is contained in:
JaguarJack 2020-06-24 09:46:21 +08:00
parent ee04005d69
commit f6783cb13e
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
namespace catcher; namespace catcher;
use catcher\command\install\InstallModuleServiceCommand; use catcher\command\install\ModuleServiceDiscoverCommand;
use catcher\command\publish\WechatCommand; use catcher\command\publish\WechatCommand;
use catcher\command\Tools\BackupCommand; use catcher\command\Tools\BackupCommand;
use catcher\command\Tools\CacheTrieCommand; use catcher\command\Tools\CacheTrieCommand;
@ -77,7 +77,7 @@ class CatchAdminService extends Service
ExcelTaskCommand::class, ExcelTaskCommand::class,
WechatCommand::class, WechatCommand::class,
CacheTrieCommand::class, CacheTrieCommand::class,
InstallModuleServiceCommand::class, ModuleServiceDiscoverCommand::class,
]); ]);
} }
/** /**

View File

@ -16,7 +16,7 @@ use think\console\Input;
use think\console\input\Option; use think\console\input\Option;
use think\console\Output; use think\console\Output;
class InstallModuleServiceCommand extends Command class ModuleServiceDiscoverCommand extends Command
{ {
protected function configure() protected function configure()
{ {
@ -79,13 +79,13 @@ PHP
if ($module) { if ($module) {
$moduleInfo = CatchAdmin::getModuleInfo(CatchAdmin::directory() . $module); $moduleInfo = CatchAdmin::getModuleInfo(CatchAdmin::directory() . $module);
if (isset($moduleInfo['services']) && !empty($moduleInfo['services'])) { if (isset($moduleInfo['services']) && !empty($moduleInfo['services'])) {
return $moduleInfo['services']; return $moduleInfo['enable'] ? $moduleInfo['services'] : [];
} else { } else {
return []; return [];
} }
} }
return CatchAdmin::getServices(); return CatchAdmin::getEnabledService();
} }
/** /**