modify
This commit is contained in:
@@ -530,18 +530,18 @@ class Node extends HttpService
|
||||
{
|
||||
try {
|
||||
if ($this->handler instanceof Closure) {
|
||||
return $this->runWith(...$param);
|
||||
return $this->runWith($this->handler, ...$param);
|
||||
}
|
||||
/** @var HttpFilter $filter */
|
||||
$filter = Snowflake::app()->get('filter');
|
||||
$validator = $filter->check(get_class($this->handler[0]), $this->handler[1]);
|
||||
if (!($validator instanceof Validator)) {
|
||||
return $this->runWith(...$param);
|
||||
return $this->runWith($this->callback, ...$param);
|
||||
}
|
||||
if (!$validator->validation()) {
|
||||
return Json::to(5005, $validator->getError());
|
||||
}
|
||||
return $this->runWith(...$param);
|
||||
return $this->runWith($this->callback, ...$param);
|
||||
} catch (Throwable $throwable) {
|
||||
$this->addError($throwable, 'throwable');
|
||||
|
||||
@@ -556,11 +556,9 @@ class Node extends HttpService
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
private function runWith(): mixed
|
||||
private function runWith($callback, ...$params): mixed
|
||||
{
|
||||
return ($this->callback)(...func_get_args());
|
||||
|
||||
return call_user_func($this->callback, ...func_get_args());
|
||||
return call_user_func($callback, ...$params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user