改名
This commit is contained in:
@@ -9,6 +9,7 @@ use HttpServer\Http\Request;
|
|||||||
use Exception;
|
use Exception;
|
||||||
use HttpServer\Application;
|
use HttpServer\Application;
|
||||||
use HttpServer\Route\Annotation\Annotation;
|
use HttpServer\Route\Annotation\Annotation;
|
||||||
|
use Snowflake\Core\JSON;
|
||||||
use Snowflake\Snowflake;
|
use Snowflake\Snowflake;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -415,6 +416,9 @@ class Node extends Application
|
|||||||
*/
|
*/
|
||||||
public function dispatch()
|
public function dispatch()
|
||||||
{
|
{
|
||||||
|
if (empty($node->callback)) {
|
||||||
|
return JSON::to(404, 'Page not found.');
|
||||||
|
}
|
||||||
return call_user_func($this->callback, \request());
|
return call_user_func($this->callback, \request());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -417,9 +417,6 @@ class Router extends Application implements RouterInterface
|
|||||||
if (!($node = $this->find_path($request))) {
|
if (!($node = $this->find_path($request))) {
|
||||||
return JSON::to(404, 'Page not found or method not allowed.');
|
return JSON::to(404, 'Page not found or method not allowed.');
|
||||||
}
|
}
|
||||||
if (empty($node->callback)) {
|
|
||||||
return JSON::to(404, 'Page not found.');
|
|
||||||
}
|
|
||||||
return $node->dispatch();
|
return $node->dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user