diff --git a/README.md b/README.md index 39527fde3..b7caae401 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Think.Admin ``` Options +FollowSymlinks -Multiviews + RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f diff --git a/application/admin/controller/Menu.php b/application/admin/controller/Menu.php index 5a56fd3a3..06fd40046 100644 --- a/application/admin/controller/Menu.php +++ b/application/admin/controller/Menu.php @@ -101,8 +101,6 @@ class Menu extends BasicAdmin { } $this->assign('nodes', array_column($nodes, 'node')); $this->assign('menus', $menus); - } else { - $this->error('请不要改菜单构造!'); } } diff --git a/application/wechat/controller/Tags.php b/application/wechat/controller/Tags.php index bfed7cc3d..0cf10d899 100644 --- a/application/wechat/controller/Tags.php +++ b/application/wechat/controller/Tags.php @@ -58,6 +58,15 @@ class Tags extends BasicAdmin { if ($this->request->isGet()) { return parent::_form($this->table, 'form', 'id'); } + $name = $this->request->post('name', ''); + empty($name) && $this->error('粉丝标签名不能为空!'); + if (Db::name($this->table)->where('name', $name)->count() > 0) { + $this->error('粉丝标签标签名已经存在,请使用其它标签名!'); + } + $result = DataService::save($this->table, ['name' => $name, 'count' => 0]); + empty($result) && $this->error('粉丝标签添加失败,请稍候再试!'); + $info = Db::name($this->table)->where('name', $name)->find(); + empty($info) && $this->error('粉丝标签添加失败,请稍候再试!'); } /**