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

pull/482/MERGE
羊小小 2025-01-13 07:55:45 +00:00 committed by Gitee
commit 70d15f68c0
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);