From 467f39771298806603869e761a858282087fc963 Mon Sep 17 00:00:00 2001 From: wolfcode <37436228+wolf-leo@users.noreply.github.com> Date: Fri, 15 Sep 2023 23:38:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BC=94=E7=A4=BA=E7=8E=AF=E5=A2=83=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/system/Log.php | 3 +++ app/admin/traits/Curd.php | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/admin/controller/system/Log.php b/app/admin/controller/system/Log.php index 2db02f8..776f381 100644 --- a/app/admin/controller/system/Log.php +++ b/app/admin/controller/system/Log.php @@ -64,6 +64,9 @@ class Log extends AdminController */ public function export() { + if (env('EASYADMIN.IS_DEMO', false)) { + $this->error('演示环境下不允许操作'); + } [$page, $limit, $where, $excludeFields] = $this->buildTableParams(['month']); $tableName = $this->model->getName(); $tableName = CommonTool::humpToLine(lcfirst($tableName)); diff --git a/app/admin/traits/Curd.php b/app/admin/traits/Curd.php index a229a4a..8d143e0 100644 --- a/app/admin/traits/Curd.php +++ b/app/admin/traits/Curd.php @@ -15,7 +15,6 @@ use think\facade\Db; trait Curd { - /** * @NodeAnnotation(title="列表") */ @@ -107,6 +106,9 @@ trait Curd */ public function export() { + if (env('EASYADMIN.IS_DEMO', false)) { + $this->error('演示环境下不允许操作'); + } list($page, $limit, $where) = $this->buildTableParams(); $tableName = $this->model->getName(); $tableName = CommonTool::humpToLine(lcfirst($tableName)); @@ -137,9 +139,9 @@ trait Curd $this->checkPostRequest(); $post = $this->request->post(); $rule = [ - 'id|ID' => 'require', + 'id|ID' => 'require', 'field|字段' => 'require', - 'value|值' => 'require', + 'value|值' => 'require', ]; $this->validate($post, $rule); $row = $this->model->find($post['id']);