diff --git a/library/think/controller/Rest.php b/library/think/controller/Rest.php index b08c6997..3a759eea 100644 --- a/library/think/controller/Rest.php +++ b/library/think/controller/Rest.php @@ -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); } }