Pre Merge pull request !418 from 羊小小/develop

pull/418/MERGE
羊小小 2024-04-26 03:46:58 +00:00 committed by Gitee
commit b25e10e7fd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 7 additions and 2 deletions

View File

@ -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);