Files
lsky-pro/application/index/controller/admin/Base.php
T
WispX 472604ee12 up
2018-10-15 18:57:05 +08:00

36 lines
740 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
{
public 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;
}
}