修正rest控制器类

This commit is contained in:
thinkphp
2016-05-17 08:44:07 +08:00
parent f13596e4f6
commit 7be184a7a5

View File

@@ -94,9 +94,9 @@ abstract class Rest
protected function response($data, $type = 'json', $code = 200)
{
if('json'==$type){
return new Json($data)->code($code);
return (new Json($data))->code($code);
}else{
return new Response($data,$type)->code($code);
return (new Response($data,$type))->code($code);
}
}