优化为 ConfigModel

pull/263/head
cf king 2020-12-10 17:43:56 +08:00
parent 8af7f5653a
commit 9c13b07f73
1 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,8 @@ class Config extends Backend
public function _initialize()
{
parent::_initialize();
$this->model = model('Config');
// $this->model = model('Config');
$this->model = new ConfigModel;
ConfigModel::event('before_write', function ($row) {
if (isset($row['name']) && $row['name'] == 'name' && preg_match("/fast" . "admin/i", $row['value'])) {
throw new Exception(__("Site name incorrect"));