From 07e56084476b654ce6ef63077f3895a5028977c6 Mon Sep 17 00:00:00 2001 From: Karson <karsonzhang@163.com> Date: Sat, 8 Jun 2019 09:50:27 +0800 Subject: [PATCH] 优化会员退出逻辑和mobilelogin鉴权判断 --- 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 8c56936..ddc43d3 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 0387d19..5619814 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 { -- libgit2 0.24.0