This commit is contained in:
2021-05-20 15:02:46 +08:00
parent b261961665
commit 6560ea4930
+5 -4
View File
@@ -121,15 +121,16 @@ class Node extends HttpService
*/
public function createDispatch(): Closure
{
return static function () {
$handler = $this->handler;
return static function () use ($handler) {
$dispatchParam = Context::getContext('dispatch-param');
if (empty($dispatchParam)) {
$dispatchParam = [\request()];
}
if ($this->handler instanceof Closure) {
return call_user_func($this->handler, ...$dispatchParam);
if ($handler instanceof Closure) {
return call_user_func($handler, ...$dispatchParam);
}
return \aop($this->handler, $dispatchParam);
return \aop($handler, $dispatchParam);
};
}