更新
This commit is contained in:
@@ -8,8 +8,6 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* @title 后端公共模块
|
||||
*/
|
||||
@@ -26,14 +24,14 @@ class Admin extends Base {
|
||||
],
|
||||
];
|
||||
|
||||
protected $middleware = [
|
||||
'\app\http\middleware\Validate',
|
||||
'\app\http\middleware\Admin',
|
||||
];
|
||||
// protected $middleware = [
|
||||
// '\app\http\middleware\Validate',
|
||||
// '\app\http\middleware\Admin',
|
||||
// ];
|
||||
|
||||
protected function initialize() {
|
||||
Db::name('config')->select();
|
||||
if (!is_login() and !in_array($this->request->url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) {
|
||||
$url = str_replace(".", "/", strtolower($this->request->controller())) . '/' . $this->request->action();
|
||||
if (!is_login() and !in_array($url, array('admin/index/login', 'admin/index/logout', 'admin/index/verify'))) {
|
||||
$this->redirect('admin/index/login');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user