This commit is contained in:
as2252258@163.com
2021-04-21 01:43:37 +08:00
parent 5cf3596c92
commit 09a466fdf4
+6 -6
View File
@@ -36,11 +36,6 @@ class Dispatch
{
$class = new static();
$class->handler = $handler;
$dispatchParam = Context::getContext('dispatch-param');
if (empty($dispatchParam)) {
$dispatchParam = [\request()];
}
$class->request = $dispatchParam;
if ($handler instanceof Closure) {
$class->bind();
}
@@ -57,7 +52,12 @@ class Dispatch
public function dispatch(): mixed
{
// return call_user_func($this->handler, $this->request);
return \aop($this->handler, ...$this->request);
$dispatchParam = Context::getContext('dispatch-param');
if (empty($dispatchParam)) {
$dispatchParam = [\request()];
}
return \aop($this->handler, $dispatchParam);
}