Response类增加getCode方法和getContent方法 send方法data参数去掉 App类的run方法返回response对象

This commit is contained in:
thinkphp
2016-06-13 16:45:39 +08:00
parent a9cfe2a801
commit 4689c86e0a
4 changed files with 49 additions and 15 deletions

View File

@@ -123,12 +123,12 @@ class App
// 输出数据到客户端
if ($data instanceof Response) {
return $data->send();
return $data;
} elseif (!is_null($data)) {
// 默认自动识别响应输出类型
$isAjax = $request->isAjax();
$type = $isAjax ? Config::get('default_ajax_return') : Config::get('default_return_type');
return Response::create($data, $type)->send();
return Response::create($data, $type);
}
}