益处service

This commit is contained in:
wuyanwen 2020-02-20 13:44:54 +08:00
parent bcb671697c
commit 6c5383f83c

View File

@ -1,13 +1,6 @@
<?php <?php
namespace catchAdmin; namespace catcher;
use catchAdmin\login\LoginLogListener;
use catchAdmin\permissions\OperateLogListener;
use catchAdmin\permissions\PermissionsMiddleware;
use catchAdmin\system\event\LoginLogEvent;
use catchAdmin\system\event\OperateLogEvent;
use catcher\CatchExceptionHandle;
use catcher\CatchQuery;
use catcher\command\BackupCommand; use catcher\command\BackupCommand;
use catcher\command\CompressPackageCommand; use catcher\command\CompressPackageCommand;
use catcher\command\CreateModuleCommand; use catcher\command\CreateModuleCommand;
@ -19,8 +12,6 @@ use catcher\command\ModelGeneratorCommand;
use catcher\command\ModuleCacheCommand; use catcher\command\ModuleCacheCommand;
use catcher\command\SeedRunCommand; use catcher\command\SeedRunCommand;
use catcher\command\worker\WsWorkerCommand; use catcher\command\worker\WsWorkerCommand;
use catcher\event\LoadModuleRoutes;
use catcher\validates\Sometimes;
use think\exception\Handle; use think\exception\Handle;
use think\facade\Validate; use think\facade\Validate;
use think\Service; use think\Service;
@ -110,20 +101,16 @@ class CatchAdminService extends Service
*/ */
protected function registerListeners(): void protected function registerListeners(): void
{ {
$this->app->event->listenEvents([ $this->app->event->listenEvents(config('catch.events'));
'loginLog' => [
LoginLogListener::class,
],
'operateLog' => [
OperateLogListener::class,
],
'RouteLoaded' => [
LoadModuleRoutes::class
],
]);
} }
protected function registerQuery() /**
* register query
*
* @time 2020年02月20日
* @return void
*/
protected function registerQuery(): void
{ {
$connections = $this->app->config->get('database.connections'); $connections = $this->app->config->get('database.connections');
@ -134,7 +121,13 @@ class CatchAdminService extends Service
], 'database'); ], 'database');
} }
protected function registerExceptionHandle() /**
* register exception
*
* @time 2020年02月20日
* @return void
*/
protected function registerExceptionHandle(): void
{ {
$this->app->bind(Handle::class, CatchExceptionHandle::class); $this->app->bind(Handle::class, CatchExceptionHandle::class);
} }