This commit is contained in:
as2252258@163.com
2021-04-21 01:53:48 +08:00
parent ea4fe5f390
commit a82e7e363f
+4 -4
View File
@@ -549,18 +549,18 @@ class Node extends HttpService
* @return Validator|bool * @return Validator|bool
* @throws Exception * @throws Exception
*/ */
private function runValidator($dispatchParams): string private function runValidator($dispatchParams): mixed
{ {
/** @var HttpFilter $filter */ /** @var HttpFilter $filter */
$filter = Snowflake::app()->get('filter'); $filter = Snowflake::app()->get('filter');
$validator = $filter->check(get_class($this->handler[0]), $this->handler[1]); $validator = $filter->check(get_class($this->handler[0]), $this->handler[1]);
if (!($validator instanceof Validator)) { if (!($validator instanceof Validator)) {
return call_user_func($this->callback, ...$dispatchParams); return call_user_func($this->callback, ...$dispatchParams);
} } else if ($validator->validation()) {
if ($validator->validation()) {
return call_user_func($this->callback, ...$dispatchParams); return call_user_func($this->callback, ...$dispatchParams);
} else {
return Json::to(5005, $validator->getError());
} }
return Json::to(5005, $validator->getError());
} }