This commit is contained in:
2021-08-03 15:19:23 +08:00
parent fed06d7728
commit c143995fbd
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -209,11 +209,11 @@ class Response extends HttpService
private function printResult($result): void
{
$result = Help::toString($result);
$string = 'Command Result: ' . PHP_EOL . PHP_EOL;
fire('CONSOLE_END');
if (str_contains((string)$result, 'Event::rshutdown(): Event::wait()')) {
return;
}
$string = 'Command Result: ' . PHP_EOL . PHP_EOL;
if (empty($result)) {
$string .= 'success!' . PHP_EOL . PHP_EOL;
} else {
@@ -224,6 +224,7 @@ class Response extends HttpService
/**
* @param $sendData
* @throws Exception
*/
private function sendData($sendData): void
{
+2 -2
View File
@@ -513,7 +513,7 @@ class Router extends HttpService implements RouterInterface
$node = $this->find_path($request);
if (!($node instanceof Node)) {
$this->response->setFormat(Response::HTML);
$this->response->send('<h1 style="text-align: center;">404</h1>');
$this->response->send('<h2>HTTP 404 Not Found</h2><hr><i>Powered by Swoole</i>');
} else {
$this->response->send($node->dispatch(), 200);
}
@@ -526,7 +526,7 @@ class Router extends HttpService implements RouterInterface
public function pageNotFound()
{
$this->response->setFormat(Response::HTML);
$this->response->send('<h1 style="text-align: center;">404</h1>');
$this->response->send('<h2>HTTP 404 Not Found</h2><hr><i>Powered by Swoole</i>');
}