去除Response类的result方法 改进Jump里面的result方法

This commit is contained in:
thinkphp
2016-06-17 16:19:09 +08:00
parent e20db2b31a
commit 9d56033b6d
2 changed files with 8 additions and 20 deletions

View File

@@ -99,7 +99,14 @@ trait Jump
*/
protected function result($data, $code = 0, $msg = '', $type = '')
{
return Response::create([], $type)->result($data, $code, $msg);
$result = [
'code' => $code,
'msg' => $msg,
'time' => $_SERVER['REQUEST_TIME'],
'data' => $data,
];
$type = $type ?: $this->getResponseType();
return Response::create([], $type)->data($data);
}
/**