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 @@
- EasyWeb后台开发框架 + CatchAdmin 后台管理系统
diff --git a/catchAdmin/permissions/view/permission/index.html b/catchAdmin/permissions/view/permission/index.html index 2327f54..c0aab3f 100644 --- a/catchAdmin/permissions/view/permission/index.html +++ b/catchAdmin/permissions/view/permission/index.html @@ -20,9 +20,9 @@
{/block} {block name="script"} diff --git a/catchAdmin/permissions/view/role/index.html b/catchAdmin/permissions/view/role/index.html index 5687279..e3c3033 100644 --- a/catchAdmin/permissions/view/role/index.html +++ b/catchAdmin/permissions/view/role/index.html @@ -20,9 +20,9 @@
{/block} {block name="script"} diff --git a/catchAdmin/user/Auth.php b/catchAdmin/user/Auth.php index 6095ad3..848c3bb 100644 --- a/catchAdmin/user/Auth.php +++ b/catchAdmin/user/Auth.php @@ -1,8 +1,8 @@ get->getPermissionsBy(); + + $permissionId = Permissions::where('module', $module) + ->where('permission_mark', $mark)->value('id'); + + return in_array($permissionId, $permissionIds); + } } diff --git a/catchAdmin/user/view/index.html b/catchAdmin/user/view/index.html index 39d23c2..51e899f 100644 --- a/catchAdmin/user/view/index.html +++ b/catchAdmin/user/view/index.html @@ -47,7 +47,7 @@
diff --git a/extend/catcher/exceptions/CatchException.php b/extend/catcher/exceptions/CatchException.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/extend/catcher/exceptions/CatchException.php @@ -0,0 +1 @@ +