mirror of https://gitee.com/karson/fastadmin.git
Pre Merge pull request !418 from 羊小小/develop
commit
b25e10e7fd
|
|
@ -15,8 +15,7 @@ use think\Validate;
|
|||
*/
|
||||
class Index extends Backend
|
||||
{
|
||||
|
||||
protected $noNeedLogin = ['login'];
|
||||
protected $noNeedLogin = ['login', 'logout'];
|
||||
protected $noNeedRight = ['index', 'logout'];
|
||||
protected $layout = '';
|
||||
|
||||
|
|
@ -127,6 +126,12 @@ class Index extends Backend
|
|||
*/
|
||||
public function logout()
|
||||
{
|
||||
//先判断用户身份是否有效
|
||||
$res = $this->auth->getUserInfo();
|
||||
if (!$res){
|
||||
Hook::listen("admin_logout_after", $this->request);
|
||||
$this->success(__('Logout successful'), 'index/login');
|
||||
}
|
||||
if ($this->request->isPost()) {
|
||||
$this->auth->logout();
|
||||
Hook::listen("admin_logout_after", $this->request);
|
||||
|
|
|
|||
Loading…
Reference in New Issue