mirror of https://github.com/1099438829/apeblog
This commit is contained in:
parent
09b50b2733
commit
1e51b08807
|
|
@ -95,7 +95,7 @@ abstract class AuthController extends SystemBasic
|
||||||
$this->module = App::getInstance()->http->getName();
|
$this->module = App::getInstance()->http->getName();
|
||||||
$this->controller = un_camelize($this->request->controller());
|
$this->controller = un_camelize($this->request->controller());
|
||||||
$this->action = $this->request->action();
|
$this->action = $this->request->action();
|
||||||
$this->auth = explode(",", AdminRole::getAuth($this->adminInfo['role_id'] ?? 0));
|
$this->auth = explode(",", $this->adminInfo['role_auth']??'');
|
||||||
$this->nowAuthId = AdminAuth::getAuthId($this->module,$this->controller,$this->action);
|
$this->nowAuthId = AdminAuth::getAuthId($this->module,$this->controller,$this->action);
|
||||||
$this->model = $this->buildModel($this->module,$this->request->controller());
|
$this->model = $this->buildModel($this->module,$this->request->controller());
|
||||||
// 鉴权
|
// 鉴权
|
||||||
|
|
@ -117,7 +117,7 @@ abstract class AuthController extends SystemBasic
|
||||||
if (!self::isActive()) exit($this->failedNotice(lang("未登录"),"/admin/login/login"));
|
if (!self::isActive()) exit($this->failedNotice(lang("未登录"),"/admin/login/login"));
|
||||||
// 权限验证
|
// 权限验证
|
||||||
if ($this->nowAuthId == -1 || in_array($this->nowAuthId,$this->auth)) return true;
|
if ($this->nowAuthId == -1 || in_array($this->nowAuthId,$this->auth)) return true;
|
||||||
exit($this->failed(lang('没有权限!')));
|
exit($this->failed(lang('没有权限访问!')));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@ class Index extends AuthController
|
||||||
{
|
{
|
||||||
// 无需登录的
|
// 无需登录的
|
||||||
protected $noNeedLogin = ['test','accessauth','pddlogin'];
|
protected $noNeedLogin = ['test','accessauth','pddlogin'];
|
||||||
// 无需权限的
|
|
||||||
protected $noNeedRight = [''];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 后台首页
|
* 后台首页
|
||||||
* @return string
|
* @return string
|
||||||
|
|
@ -22,8 +19,12 @@ class Index extends AuthController
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->assign("adminInfo",$this->adminInfo);
|
$this->assign("adminInfo",$this->adminInfo);
|
||||||
$this->assign("menu",AdminAuth::getMenu(0,$this->auth));
|
$menuList = cache(AdminAuth::getMenuCacheKey($this->adminId));
|
||||||
$this->assign("message",AdminNotify::pageList(5));
|
if($menuList === null){
|
||||||
|
$menuList = AdminAuth::getMenu(0,$this->auth);
|
||||||
|
cache(AdminAuth::getMenuCacheKey($this->adminId),$menuList,1*60*60);
|
||||||
|
}
|
||||||
|
$this->assign("menu",$menuList);
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,6 +46,11 @@ class Index extends AuthController
|
||||||
*/
|
*/
|
||||||
public function menu()
|
public function menu()
|
||||||
{
|
{
|
||||||
return app("json")->success(AdminAuth::getMenu(0,$this->auth));
|
$menuList = cache(AdminAuth::getMenuCacheKey($this->adminId));
|
||||||
|
if($menuList === null){
|
||||||
|
$menuList = AdminAuth::getMenu(0,$this->auth);
|
||||||
|
cache(AdminAuth::getMenuCacheKey($this->adminId),$menuList,1*60*60);
|
||||||
|
}
|
||||||
|
return app("json")->success($menuList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="post-list">
|
<ul class="post-list">
|
||||||
{zz:list pagesize="3" typeid="$cid" orderby="create_time desc"}
|
{zz:arclist pagesize="3" typeid="$cid" type="find" orderby="create_time desc"}
|
||||||
<li class="post-item ">
|
<li class="post-item ">
|
||||||
<div class="post-item-container">
|
<div class="post-item-container">
|
||||||
<div class="post-item-thumbnail">
|
<div class="post-item-thumbnail">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue