修改wechat commands 注入方式

This commit is contained in:
JaguarJack 2020-07-02 14:01:47 +08:00
parent 26e26b60a7
commit e51cbc6850
3 changed files with 54 additions and 62 deletions

View File

@ -16,21 +16,17 @@ class CatchWechatService extends ModuleService
public function register()
{
parent::register();
$this->registerCommand();
}
/**
* register command
*
* @time 2020年06月24日
* @return void
* @return array
*/
public function registerCommand()
public function loadCommands()
{
$this->commands([
SyncUsersCommand::class,
]);
return [__NAMESPACE__, __DIR__ . DIRECTORY_SEPARATOR . 'command'];
}
/**

View File

@ -8,14 +8,11 @@
* @copyright By CatchAdmin
* @license https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt
*/
namespace catcher\command\publish;
namespace catchAdmin\wechat\command;
use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use catcher\CatchAdmin;
class WechatCommand extends Command
{

View File

@ -48,4 +48,3 @@ $router->group('wechat', function () use ($router){
// 消息
$router->rule('wechat', '\catchAdmin\wechat\controller\Message@done', 'GET|POST');