response类增加create方法 改进think\response\redirect类 改进助手函数和traits\controller\Jump

This commit is contained in:
thinkphp
2016-05-17 11:17:24 +08:00
parent df96d049b9
commit 92d999b484
6 changed files with 73 additions and 76 deletions

View File

@@ -12,7 +12,6 @@
namespace think\controller;
use think\Response;
use think\response\Json;
abstract class Rest
{
@@ -93,11 +92,7 @@ abstract class Rest
*/
protected function response($data, $type = 'json', $code = 200)
{
if('json'==$type){
return (new Json($data))->code($code);
}else{
return (new Response($data,$type))->code($code);
}
return Response::create($data, $type)->code($code);
}
/**