This commit is contained in:
as2252258@163.com
2021-04-21 01:40:00 +08:00
parent 2a4cca4b61
commit 52886be6aa
2 changed files with 8 additions and 5 deletions
+3 -4
View File
@@ -17,6 +17,7 @@ use HttpServer\Controller;
use HttpServer\Http\Context;
use HttpServer\Http\Request;
use HttpServer\HttpFilter;
use HttpServer\Route\Dispatch\Dispatch;
use JetBrains\PhpStorm\Pure;
use Snowflake\Core\Json;
use Snowflake\Snowflake;
@@ -126,10 +127,8 @@ class Node extends HttpService
public function createDispatch(): Closure
{
return function () {
$dispatchParam = Context::getContext('dispatch-param');
if (empty($dispatchParam)) {
$dispatchParam = [\request()];
}
return Dispatch::create($this->handler,\request())->dispatch();
return call_user_func($this->handler, ...$dispatchParam);
};
}