优化会员退出逻辑和mobilelogin鉴权判断

pull/131/MERGE
Karson 2019-06-08 09:50:27 +08:00
parent f9d14aa693
commit 07e5608447
2 changed files with 5 additions and 3 deletions

View File

@ -72,10 +72,9 @@ class Auth extends \fast\Auth
{ {
$admin = Admin::get(intval($this->id)); $admin = Admin::get(intval($this->id));
if (!$admin) { if (!$admin) {
return true; $admin->token = '';
$admin->save();
} }
$admin->token = '';
$admin->save();
$this->logined = false; //重置登录状态 $this->logined = false; //重置登录状态
Session::delete("admin"); Session::delete("admin");
Cookie::delete("keeplogin"); Cookie::delete("keeplogin");

View File

@ -72,6 +72,9 @@ class User extends Api
} }
$user = \app\common\model\User::getByMobile($mobile); $user = \app\common\model\User::getByMobile($mobile);
if ($user) { if ($user) {
if ($user->status != 'normal') {
$this->error(__('Account is locked'));
}
//如果已经有账号则直接登录 //如果已经有账号则直接登录
$ret = $this->auth->direct($user->id); $ret = $this->auth->direct($user->id);
} else { } else {