系统设置初始化

This commit is contained in:
2020-04-19 10:20:43 +08:00
parent 99a93a65aa
commit 35ba9110d3
3 changed files with 17 additions and 19 deletions

View File

@@ -12,10 +12,10 @@ use think\App;
use think\exception\ValidateException;
use think\facade\View;
use think\facade\Cache;
use think\Validate;
use app\model\Config;
use think\facade\Route;
use think\facade\Event;
use think\Validate;
use app\model\Config;
use app\model\Hooks;
use app\model\SeoRule;
@@ -59,6 +59,7 @@ class Base {
];
public $data = []; //渲染数据
public $config = [];
/**
* 构造方法
@@ -69,10 +70,10 @@ class Base {
$this->app = $app;
$this->request = $this->app->request;
$config = Cache::get('system_config_data');
if (!$config) {
$config = Config::getConfigList($this->request);
Cache::set('system_config_data', $config);
$this->config = Cache::get('system_config_data');
if (!$this->config) {
$this->config = Config::getConfigList($this->request);
Cache::set('system_config_data', $this->config);
}
$hooks = Cache::get('sentcms_hooks');
if (!$hooks) {
@@ -96,7 +97,7 @@ class Base {
View::assign('version', \think\facade\Env::get('VERSION'));
View::assign('config', $config);
View::assign('config', $this->config);
// 控制器初始化
$this->initialize();
}