Files
lsky-pro/application/index/controller/admin/Base.php
T
Wisp X 8e1024d8e3 up
2018-11-21 11:57:24 +08:00

37 lines
744 B
PHP

<?php
/**
* User: Wisp X
* Date: 2018/9/27
* Time: 上午10:14
* Link: https://github.com/wisp-x
*/
namespace app\index\controller\admin;
use app\index\controller\Base as AdminBase;
class Base extends AdminBase
{
protected function initialize()
{
parent::initialize();
if (!$this->user) {
$this->redirect(url('auth/login'));
}
if (!$this->user->is_admin) {
$this->redirect(url('/'));
}
}
protected function getConfigs($keys)
{
$configs = [];
foreach ($this->configs as &$value) {
if (in_array($value->key, $keys)) {
$configs[$value->key][] = $value;
}
}
return $configs;
}
}