益处service
This commit is contained in:
parent
bcb671697c
commit
6c5383f83c
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user