This commit is contained in:
2021-04-27 11:38:03 +08:00
parent 3035f62fdc
commit 7d804f3a25
+9 -10
View File
@@ -179,16 +179,16 @@ class Response extends HttpService
*/ */
private function parseData($context): mixed private function parseData($context): mixed
{ {
if ($context === null) { if (empty($context)) {
if (isset($this->_format_maps[$this->format])) { return $context;
$class['class'] = $this->_format_maps[$this->format];
} else {
$class['class'] = HtmlFormatter::class;
}
$format = Snowflake::createObject($class);
return $format->send($context)->getData();
} }
return $context; if (isset($this->_format_maps[$this->format])) {
$class['class'] = $this->_format_maps[$this->format];
} else {
$class['class'] = HtmlFormatter::class;
}
$format = Snowflake::createObject($class);
return $format->send($context)->getData();
} }
/** /**
@@ -228,7 +228,6 @@ class Response extends HttpService
if (!swoole()->exist($response->fd)) { if (!swoole()->exist($response->fd)) {
return; return;
} }
var_dump($sendData);
if (is_array($sendData)) { if (is_array($sendData)) {
$sendData = Json::encode($sendData); $sendData = Json::encode($sendData);
} }