[更新]后台无菜单未登录时跳转到登录页

This commit is contained in:
Anyon 2018-03-14 10:19:59 +08:00
parent 5c56b5fb82
commit 6d2a9f81de

View File

@ -42,6 +42,9 @@ class Index extends BasicAdmin
NodeService::applyAuthNode();
$list = (array)Db::name('SystemMenu')->where(['status' => '1'])->order('sort asc,id asc')->select();
$menus = $this->buildMenuData(ToolsService::arr2tree($list), NodeService::get(), !!session('user'));
if (empty($menus) && !session('user.id')) {
$this->redirect('@admin/login');
}
return $this->fetch('', ['title' => '系统管理', 'menus' => $menus]);
}