This commit is contained in:
2021-04-22 14:43:05 +08:00
parent 47cf262128
commit dfcf1bf411
2 changed files with 5 additions and 65 deletions
+5 -2
View File
@@ -17,7 +17,6 @@ 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;
@@ -127,7 +126,11 @@ class Node extends HttpService
public function createDispatch(): Closure
{
return function () {
return Dispatch::create($this->handler)->dispatch();
$dispatchParam = Context::getContext('dispatch-param');
if (empty($dispatchParam)) {
$dispatchParam = [\request()];
}
return \aop($this->handler, $dispatchParam);
};
}