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
|
class Index extends Backend
|
||||||
{
|
{
|
||||||
|
protected $noNeedLogin = ['login', 'logout'];
|
||||||
protected $noNeedLogin = ['login'];
|
|
||||||
protected $noNeedRight = ['index', 'logout'];
|
protected $noNeedRight = ['index', 'logout'];
|
||||||
protected $layout = '';
|
protected $layout = '';
|
||||||
|
|
||||||
|
|
@ -127,6 +126,12 @@ class Index extends Backend
|
||||||
*/
|
*/
|
||||||
public function logout()
|
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()) {
|
if ($this->request->isPost()) {
|
||||||
$this->auth->logout();
|
$this->auth->logout();
|
||||||
Hook::listen("admin_logout_after", $this->request);
|
Hook::listen("admin_logout_after", $this->request);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue