modify
This commit is contained in:
@@ -176,7 +176,13 @@ class Node extends HttpService
|
|||||||
*/
|
*/
|
||||||
public function afterDispatch($response = null): mixed
|
public function afterDispatch($response = null): mixed
|
||||||
{
|
{
|
||||||
return (Reduce::after($this->_after))(\request(), $response);
|
if (is_object($this->_after[0])) {
|
||||||
|
return call_user_func($this->_after, \request(), $response);
|
||||||
|
}
|
||||||
|
foreach ($this->_after as $value) {
|
||||||
|
call_user_func($value, \request(), $response);
|
||||||
|
}
|
||||||
|
return $this->_after;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -589,7 +595,7 @@ class Node extends HttpService
|
|||||||
}
|
}
|
||||||
return $this->runWith(...func_get_args());
|
return $this->runWith(...func_get_args());
|
||||||
} catch (Throwable $throwable) {
|
} catch (Throwable $throwable) {
|
||||||
$this->addError($throwable,'throwable');
|
$this->addError($throwable, 'throwable');
|
||||||
return Json::to(401, $throwable->getMessage());
|
return Json::to(401, $throwable->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user