From 07e56084476b654ce6ef63077f3895a5028977c6 Mon Sep 17 00:00:00 2001 From: Karson Date: Sat, 8 Jun 2019 09:50:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BC=9A=E5=91=98=E9=80=80?= =?UTF-8?q?=E5=87=BA=E9=80=BB=E8=BE=91=E5=92=8Cmobilelogin=E9=89=B4?= =?UTF-8?q?=E6=9D=83=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/library/Auth.php | 5 ++--- application/api/controller/User.php | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/admin/library/Auth.php b/application/admin/library/Auth.php index 8c569360..ddc43d30 100644 --- a/application/admin/library/Auth.php +++ b/application/admin/library/Auth.php @@ -72,10 +72,9 @@ class Auth extends \fast\Auth { $admin = Admin::get(intval($this->id)); if (!$admin) { - return true; + $admin->token = ''; + $admin->save(); } - $admin->token = ''; - $admin->save(); $this->logined = false; //重置登录状态 Session::delete("admin"); Cookie::delete("keeplogin"); diff --git a/application/api/controller/User.php b/application/api/controller/User.php index 0387d195..56198141 100644 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -72,6 +72,9 @@ class User extends Api } $user = \app\common\model\User::getByMobile($mobile); if ($user) { + if ($user->status != 'normal') { + $this->error(__('Account is locked')); + } //如果已经有账号则直接登录 $ret = $this->auth->direct($user->id); } else {