From 75e91b281cb7c2b37c0d136163b68be6ca20dcc4 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 20 Jan 2020 14:47:36 +0800 Subject: [PATCH] update --- app/Http/Controllers/Passport/LoginController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Http/Controllers/Passport/LoginController.php b/app/Http/Controllers/Passport/LoginController.php index 64d36137..5a1f89fd 100755 --- a/app/Http/Controllers/Passport/LoginController.php +++ b/app/Http/Controllers/Passport/LoginController.php @@ -24,6 +24,10 @@ class LoginController extends Controller abort(500, '用户名或密码错误'); } + if (!$user->enable) { + abort(500, '该账户已被停止使用'); + } + $request->session()->put('email', $user->email); $request->session()->put('id', $user->id); if ($user->is_admin) { @@ -66,6 +70,9 @@ class LoginController extends Controller if (!$user) { abort(500, '用户不存在'); } + if (!$user->enable) { + abort(500, '该账户已被停止使用'); + } $request->session()->put('email', $user->email); $request->session()->put('id', $user->id); if ($user->is_admin) {