modify
This commit is contained in:
@@ -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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user