This commit is contained in:
2021-04-19 16:53:22 +08:00
parent 087cba00b0
commit e6e0c9e62c
+12 -11
View File
@@ -529,21 +529,22 @@ class Node extends HttpService
private function httpFilter(): mixed private function httpFilter(): mixed
{ {
try { try {
$requestParam = func_get_args();
if ($this->handler instanceof Closure) { if ($this->handler instanceof Closure) {
return $this->runWith(...func_get_args()); return $this->runWith(...$requestParam);
} }
/** @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 $this->runWith(...func_get_args()); // return $this->runWith(...$requestParam);
} // }
//
if (!$validator->validation()) { // if (!$validator->validation()) {
return Json::to(5005, $validator->getError()); // return Json::to(5005, $validator->getError());
} // }
return $this->runWith(...func_get_args()); return $this->runWith(...$requestParam);
} catch (Throwable $throwable) { } catch (Throwable $throwable) {
$this->addError($throwable, 'throwable'); $this->addError($throwable, 'throwable');