Update Index.php

This commit is contained in:
Anyon 2019-11-28 17:49:07 +08:00
parent 4b5c6d3316
commit 1252dafa8a

View File

@ -38,9 +38,9 @@ class Index extends Controller
public function index() public function index()
{ {
$this->title = '系统管理后台'; $this->title = '系统管理后台';
$auth = AdminService::instance()->apply(true); $login = AdminService::instance()->apply(true)->isLogin();
$this->menus = MenuService::instance()->getTree(); $this->menus = MenuService::instance()->getTree();
if (empty($this->menus) && !$auth->isLogin()) { if (empty($this->menus) && empty($login)) {
$this->redirect(url('@admin/login')); $this->redirect(url('@admin/login'));
} else { } else {
$this->fetch(); $this->fetch();