modify
This commit is contained in:
@@ -544,12 +544,13 @@ class Node extends HttpService
|
|||||||
*/
|
*/
|
||||||
private function runValidator($dispatchParams): mixed
|
private function runValidator($dispatchParams): mixed
|
||||||
{
|
{
|
||||||
|
if (empty($this->rules) || !is_array($this->rules)) {
|
||||||
|
return call_user_func($this->callback, ...$dispatchParams);
|
||||||
|
}
|
||||||
/** @var HttpFilter $filter */
|
/** @var HttpFilter $filter */
|
||||||
$filter = Snowflake::app()->get('filter');
|
$filter = Snowflake::app()->get('filter');
|
||||||
$validator = $filter->check($this->rules);
|
$validator = $filter->check($this->rules);
|
||||||
if (!($validator instanceof Validator)) {
|
if (!($validator instanceof Validator) || $validator->validation()) {
|
||||||
return call_user_func($this->callback, ...$dispatchParams);
|
|
||||||
} else if ($validator->validation()) {
|
|
||||||
return call_user_func($this->callback, ...$dispatchParams);
|
return call_user_func($this->callback, ...$dispatchParams);
|
||||||
} else {
|
} else {
|
||||||
return Json::to(5005, $validator->getError());
|
return Json::to(5005, $validator->getError());
|
||||||
|
|||||||
Reference in New Issue
Block a user