改名
This commit is contained in:
@@ -117,16 +117,8 @@ class Response extends Application
|
|||||||
if ($response instanceof SResponse) {
|
if ($response instanceof SResponse) {
|
||||||
$this->response = $response;
|
$this->response = $response;
|
||||||
}
|
}
|
||||||
Coroutine::defer(function () {
|
|
||||||
unset($this->response);
|
|
||||||
});
|
|
||||||
if ($this->response instanceof SResponse) {
|
if ($this->response instanceof SResponse) {
|
||||||
$this->response->status($statusCode);
|
return $this->sendData($sendData, $statusCode);
|
||||||
$this->response->header('Content-Type', $this->getContentType());
|
|
||||||
$this->response->header('Access-Control-Allow-Origin', '*');
|
|
||||||
$this->response->header('Run-Time', $this->getRuntime());
|
|
||||||
$this->response->end($sendData);
|
|
||||||
return $sendData;
|
|
||||||
} else {
|
} else {
|
||||||
return $this->printResult($sendData);
|
return $this->printResult($sendData);
|
||||||
}
|
}
|
||||||
@@ -172,13 +164,17 @@ class Response extends Application
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $response
|
|
||||||
* @param $sendData
|
* @param $sendData
|
||||||
* @param $status
|
* @param $status
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
private function sendData($response, $sendData, $status)
|
private function sendData($sendData, $status)
|
||||||
{
|
{
|
||||||
|
$this->response->status($status);
|
||||||
|
$this->response->header('Content-Type', $this->getContentType());
|
||||||
|
$this->response->header('Access-Control-Allow-Origin', '*');
|
||||||
|
$this->response->header('Run-Time', $this->getRuntime());
|
||||||
|
$this->response->end($sendData);
|
||||||
return $sendData;
|
return $sendData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user