From 6f6d1d7eae8ffac44ab917f5e55fa6fbf62921f7 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Wed, 13 Mar 2024 10:38:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E5=90=88?= =?UTF-8?q?=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/middleware/UserTokenMiddleware.php | 2 ++ app/controller/api/Auth.php | 1 + 2 files changed, 3 insertions(+) diff --git a/app/common/middleware/UserTokenMiddleware.php b/app/common/middleware/UserTokenMiddleware.php index e7655af1..7c1c1d96 100755 --- a/app/common/middleware/UserTokenMiddleware.php +++ b/app/common/middleware/UserTokenMiddleware.php @@ -62,6 +62,8 @@ class UserTokenMiddleware extends BaseMiddleware throw new AuthException('用户不存在'); if (!$user['status']) throw new AuthException('用户已被禁用'); + if ($user['status'] == -1) + throw new AuthException('用户已被禁用'); if ($user['cancel_time']) throw new AuthException('用户不存在'); diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 5212f8d9..0b2b9d00 100755 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1769,6 +1769,7 @@ class Auth extends BaseController } $user->wechat_user_id = 0; $user->account = 'uid_' . $targetUser['uid']; + $user->status = -1; $user->save(); Db::commit(); } catch (\Throwable $e) {