This commit is contained in:
2020-12-16 15:42:27 +08:00
parent cc59427f3b
commit 21c1aaa42c
2 changed files with 4 additions and 4 deletions
+1
View File
@@ -438,6 +438,7 @@ class Node extends Application
if (empty($this->callback)) { if (empty($this->callback)) {
return JSON::to(404, $node->_error ?? 'Page not found.'); return JSON::to(404, $node->_error ?? 'Page not found.');
} }
var_dump($this->callback);
$requestParams = func_get_args(); $requestParams = func_get_args();
if (func_num_args() > 0) { if (func_num_args() > 0) {
return call_user_func($this->callback, ...$requestParams); return call_user_func($this->callback, ...$requestParams);
+3 -4
View File
@@ -481,13 +481,12 @@ class Router extends Application implements RouterInterface
return send(self::NOT_FOUND, 404); return send(self::NOT_FOUND, 404);
} }
send($node->dispatch(), 200); send($node->dispatch(), 200);
// if ($node->hasAfter()) { if ($node->hasAfter()) {
// $node->afterDispatch(\request()); $node->afterDispatch(\request());
// } }
} catch (ExitException $exception) { } catch (ExitException $exception) {
send($exception->getMessage(), $exception->getCode()); send($exception->getMessage(), $exception->getCode());
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
var_dump($exception->getMessage());
send($this->exception($exception), 200); send($this->exception($exception), 200);
} }
} }