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) {