From 66ec4f174d7ded71d5308936dc2801242d470911 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Fri, 18 Sep 2020 18:53:46 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=E4=BF=AE=E5=A4=8D=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=B2=A1=E6=9C=89=E6=8C=89=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/base/CatchRequest.php | 29 +--------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/extend/catcher/base/CatchRequest.php b/extend/catcher/base/CatchRequest.php index 46f0fd8..2745639 100644 --- a/extend/catcher/base/CatchRequest.php +++ b/extend/catcher/base/CatchRequest.php @@ -47,35 +47,8 @@ class CatchRequest extends Request $validate->batch($this->batch); } - /** - * // 场景设置验证 - * if (property_exists($this, 'scene') && !empty($this->scene)) { - * foreach ($this->scene as $scene => $rules) { - * $validate->scene($scene); - * // 只限制字段 - * if (!isset($rules['only'])) { - * $validate->only($rules); - * } else { - * $validate->only($rules['only']); - * // 新增规则 - * if (isset($rules['append'])) { - * foreach ($rules['append'] as $field => $rule) { - * $validate->append($field, $rule); - * } - * } - * // 移除规则 - * if (isset($rules['remove'])) { - * foreach ($rules['remove'] as $field => $rule) { - * $validate->remove($field, $rule); - * } - * } - * } - * - * } - * }**/ - // 验证 - if (!$validate->check(request()->param(), $this->rules())) { + if (!$validate->message($this->message())->check(request()->param(), $this->rules())) { throw new FailedException($validate->getError()); } } catch (\Exception $e) {