From dd329c6ee03627f759e35251a0020c3cc80b1fa4 Mon Sep 17 00:00:00 2001 From: lingling <1077478963@qq.com> Date: Sat, 15 Mar 2025 12:22:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=20JwtAuthMiddleware=20?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=EF=BC=8C=E5=A4=84=E7=90=86=E5=B0=81=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9A=84=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/middleware/JwtAuthMiddleware.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/middleware/JwtAuthMiddleware.php b/app/middleware/JwtAuthMiddleware.php index e76e104..90cfc1e 100644 --- a/app/middleware/JwtAuthMiddleware.php +++ b/app/middleware/JwtAuthMiddleware.php @@ -74,6 +74,10 @@ class JwtAuthMiddleware implements MiddlewareInterface if (false !== strstr($controller->name, 'admin') || false !== strstr($controller->name, 'generalization')) { return response('', 401, ['error' => '无权限']); } + $user=User::find($decoded['id']); + if($user->status==0){ + return response('',401,['error' => '用户封禁']); + } break; case 'generalization':