From 6c12887f8d5143995338c50d1c5ff0b5237bcc61 Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Sun, 15 Dec 2019 13:38:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catchAdmin/CatchAdminService.php | 9 ++++- catchAdmin/helper.php | 2 +- catchAdmin/login/controller/Index.php | 5 +-- catchAdmin/login/view/index.html | 2 +- .../permissions/view/permission/index.html | 6 ++-- catchAdmin/permissions/view/role/index.html | 6 ++-- catchAdmin/user/Auth.php | 34 +++++++++++++++++-- catchAdmin/user/view/index.html | 2 +- extend/catcher/exceptions/CatchException.php | 1 + 9 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 extend/catcher/exceptions/CatchException.php diff --git a/catchAdmin/CatchAdminService.php b/catchAdmin/CatchAdminService.php index 7809200..18044e6 100644 --- a/catchAdmin/CatchAdminService.php +++ b/catchAdmin/CatchAdminService.php @@ -6,6 +6,7 @@ use catchAdmin\permissions\OperateLogListener; use catchAdmin\permissions\PermissionsMiddleware; use catchAdmin\system\event\LoginLogEvent; use catchAdmin\system\event\OperateLogEvent; +use catchAdmin\user\Auth; use catcher\command\BackupCommand; use catcher\command\InstallCommand; use catcher\command\MigrateRunCommand; @@ -26,12 +27,12 @@ class CatchAdminService extends Service */ public function boot() { - $this->registerCommands(); $this->registerValidates(); $this->registerMiddleWares(); $this->registerEvents(); $this->registerListeners(); + $this->registerClassAlias(); } /** @@ -116,4 +117,10 @@ class CatchAdminService extends Service ]); } + + public function registerClassAlias() + { + class_alias(Auth::class, 'Auth'); + } + } \ No newline at end of file diff --git a/catchAdmin/helper.php b/catchAdmin/helper.php index 7a1b907..51f1295 100644 --- a/catchAdmin/helper.php +++ b/catchAdmin/helper.php @@ -17,7 +17,7 @@ function deleteButton($name = '删除', $event = 'del') function addButton($name = '新增', $event = 'add') { return sprintf( - '%s', + '%s', $event, $name); } diff --git a/catchAdmin/login/controller/Index.php b/catchAdmin/login/controller/Index.php index a8cf774..176b6c9 100644 --- a/catchAdmin/login/controller/Index.php +++ b/catchAdmin/login/controller/Index.php @@ -1,6 +1,7 @@