From 7be184a7a56a1e65ed46bf236c2fe41b5920dcdc Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 17 May 2016 08:44:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3rest=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/controller/Rest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } }