作者 Karson
提交者 Gitee

!263 修改 后台-》常规配置-》管理配置-》系统配置 的 初始化方法

Merge pull request !263 from 小鸡炖蘑菇/master
@@ -28,7 +28,8 @@ class Config extends Backend @@ -28,7 +28,8 @@ class Config extends Backend
28 public function _initialize() 28 public function _initialize()
29 { 29 {
30 parent::_initialize(); 30 parent::_initialize();
31 - $this->model = model('Config'); 31 + // $this->model = model('Config');
  32 + $this->model = new ConfigModel;
32 ConfigModel::event('before_write', function ($row) { 33 ConfigModel::event('before_write', function ($row) {
33 if (isset($row['name']) && $row['name'] == 'name' && preg_match("/fast" . "admin/i", $row['value'])) { 34 if (isset($row['name']) && $row['name'] == 'name' && preg_match("/fast" . "admin/i", $row['value'])) {
34 throw new Exception(__("Site name incorrect")); 35 throw new Exception(__("Site name incorrect"));