From 86a198d66a887d78c8bd2ce45fb7edd3b93354b5 Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Thu, 12 Dec 2019 22:34:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catchAdmin/CatchAdminService.php | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/catchAdmin/CatchAdminService.php b/catchAdmin/CatchAdminService.php index 8a338c1..9df52e1 100644 --- a/catchAdmin/CatchAdminService.php +++ b/catchAdmin/CatchAdminService.php @@ -1,7 +1,11 @@ registerValidates(); $this->registerMiddleWares(); + $this->registerEvents(); + $this->registerListeners(); } /** @@ -61,4 +67,38 @@ class CatchAdminService extends Service 'check_auth' => PermissionsMiddleware::class ], 'route'); } + + /** + * + * @time 2019年12月12日 + * @return void + */ + protected function registerEvents(): void + { + $this->app->event->bind([ + 'loginLog' => LoginLogEvent::class, + 'operateLog' => OperateLogEvent::class, + ]); + + + } + + /** + * 注册监听者 + * + * @time 2019年12月12日 + * @return void + */ + protected function registerListeners(): void + { + $this->app->event->listenEvents([ + 'loginLog' => [ + LoginLogListener::class, + ], + 'operateLog' => [ + OperateLogListener::class, + ], + ]); + } + } \ No newline at end of file