改名
This commit is contained in:
@@ -56,9 +56,9 @@ class Middleware
|
|||||||
public function getGenerate(Node $node): mixed
|
public function getGenerate(Node $node): mixed
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (is_array($node->handler) && is_object($node->handler[0])) {
|
// if (is_array($node->handler) && is_object($node->handler[0])) {
|
||||||
$this->set_attributes($node);
|
// $this->set_attributes($node);
|
||||||
}
|
// }
|
||||||
return $node->callback = Reduce::reduce(function () use ($node) {
|
return $node->callback = Reduce::reduce(function () use ($node) {
|
||||||
return Dispatch::create($node->handler, func_get_args())->dispatch();
|
return Dispatch::create($node->handler, func_get_args())->dispatch();
|
||||||
}, $this->annotation($node));
|
}, $this->annotation($node));
|
||||||
|
|||||||
@@ -439,15 +439,11 @@ class Node extends Application
|
|||||||
return JSON::to(404, $node->_error ?? 'Page not found.');
|
return JSON::to(404, $node->_error ?? 'Page not found.');
|
||||||
}
|
}
|
||||||
$requestParams = func_get_args();
|
$requestParams = func_get_args();
|
||||||
try {
|
|
||||||
if (func_num_args() > 0) {
|
if (func_num_args() > 0) {
|
||||||
return call_user_func($this->callback, ...$requestParams);
|
return call_user_func($this->callback, ...$requestParams);
|
||||||
} else {
|
} else {
|
||||||
return call_user_func($this->callback, \request());
|
return call_user_func($this->callback, \request());
|
||||||
}
|
}
|
||||||
} catch (Throwable $exception) {
|
|
||||||
var_dump($exception->getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user