model = new SystemConfig(); } /** * @NodeAnotation(title="列表") */ public function index() { return $this->fetch(); } /** * @NodeAnotation(title="保存") */ public function save() { $this->checkPostRequest(); $post = $this->request->post(); try { foreach ($post as $key => $val) { $this->model ->where('name', $key) ->update([ 'value' => $val, ]); } TriggerService::updateMenu(); TriggerService::updateSysconfig(); } catch (\Exception $e) { $this->error('保存失败'); } $this->success('保存成功'); } }