This commit is contained in:
2020-02-17 22:34:34 +08:00
parent 58d999ed73
commit 259d232d89
109 changed files with 10344 additions and 89 deletions

View File

@@ -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');
}
}