mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 16:12:49 +08:00
response的returnData方法增加content-length设置 #90
This commit is contained in:
@@ -52,6 +52,7 @@ class Response
|
||||
$data = $handler . '(' . \org\Transform::jsonEncode($data) . ');';
|
||||
break;
|
||||
}
|
||||
header('Content-Length:' . strlen($data));
|
||||
if ($exit) {
|
||||
exit($data);
|
||||
} else {
|
||||
@@ -88,7 +89,8 @@ class Response
|
||||
* @param mixed $wait 返回数据格式
|
||||
* @return void
|
||||
*/
|
||||
public static function success($msg = '', $data = '', $url = '', $wait = 3){
|
||||
public static function success($msg = '', $data = '', $url = '', $wait = 3)
|
||||
{
|
||||
$result = [
|
||||
'code' => 1,
|
||||
'msg' => $msg,
|
||||
@@ -113,7 +115,8 @@ class Response
|
||||
* @param mixed $wait 返回数据格式
|
||||
* @return void
|
||||
*/
|
||||
public static function error($msg = '', $data = '', $url = '', $wait = 3){
|
||||
public static function error($msg = '', $data = '', $url = '', $wait = 3)
|
||||
{
|
||||
$result = [
|
||||
'code' => 0,
|
||||
'msg' => $msg,
|
||||
|
||||
Reference in New Issue
Block a user