size = '600 * 350'; $this->keys = 'slider_home'; $this->title = '轮播图片管理'; $this->desc = "建议上传图片尺寸 {$this->size}"; $this->_apply('index'); } /** * 显示与管理 * @param string $tpl 模板名称 * @throws \think\Exception * @throws \think\exception\PDOException */ private function _apply($tpl) { if ($this->request->isGet()) { $this->list = sysdata($this->keys); $this->fetch($tpl); } else { if (sysdata($this->keys, json_decode($this->request->post('data'), true))) { $this->success('数据保存成功!', ''); } else { $this->error('数据保存失败,请稍候再试!'); } } } }