diff --git a/src/plugin/admin/api/Auth.php b/src/plugin/admin/api/Auth.php index fed477f..0e64eee 100644 --- a/src/plugin/admin/api/Auth.php +++ b/src/plugin/admin/api/Auth.php @@ -98,7 +98,6 @@ class Auth // 如果action为index,规则里有任意一个以$controller开头的权限即可 if (strtolower($action) === 'index') { - $controller = str_replace('\\', '\\\\', $controller); $rule = Rule::where(function ($query) use ($controller, $action) { $query->where('key', 'like', "$controller@%")->orWhere('key', $controller); })->whereIn('id', $rule_ids)->first(); diff --git a/src/plugin/admin/app/middleware/AccessControl.php b/src/plugin/admin/app/middleware/AccessControl.php index 4e95668..1aebaa6 100644 --- a/src/plugin/admin/app/middleware/AccessControl.php +++ b/src/plugin/admin/app/middleware/AccessControl.php @@ -37,7 +37,7 @@ class AccessControl implements MiddlewareInterface EOF ); } else { - $response = view('common/error/403'); + $response = view('common/error/403')->withStatus(403); } }