From eaf5058e5549643029eb5ea9f672dec713a8c92b Mon Sep 17 00:00:00 2001 From: ufec Date: Thu, 6 May 2021 16:50:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/middleware/AdminPermission.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/middleware/AdminPermission.php b/app/middleware/AdminPermission.php index 7bdbac1..c1691ad 100644 --- a/app/middleware/AdminPermission.php +++ b/app/middleware/AdminPermission.php @@ -23,8 +23,8 @@ class AdminPermission { */ public function handle($request, \Closure $next): Response { $userInfo = $request->API_ADMIN_USER_INFO; - - if (!$this->checkAuth($userInfo['id'], $request->pathinfo())) { + // rule里包含了rule(路由规则), ruoter(完整路由) + if (!$this->checkAuth($userInfo['id'], $request->rule()->getRule())) { return json([ 'code' => ReturnCode::INVALID, 'msg' => '非常抱歉,您没有权限这么做!',