修改response返回错误

This commit is contained in:
wuyanwen 2020-01-19 15:49:40 +08:00
parent d09bcba9f3
commit a528ee83ae

View File

@ -36,8 +36,8 @@ class CatchResponse
public static function paginate(Paginator $list) public static function paginate(Paginator $list)
{ {
return json([ return json([
'code' => 10000, 'code' => Code::SUCCESS,
'msg' => 'success', 'message' => 'success',
'count' => $list->total(), 'count' => $list->total(),
'current' => $list->currentPage(), 'current' => $list->currentPage(),
'limit' => $list->listRows(), 'limit' => $list->listRows(),
@ -53,11 +53,11 @@ class CatchResponse
* @param int $code * @param int $code
* @return Json * @return Json
*/ */
public static function fail($msg = '', $code = 10001): Json public static function fail($msg = '', $code = Code::FAILED): Json
{ {
return json([ return json([
'code' => $code, 'code' => $code,
'msg' => $msg, 'message' => $msg,
]); ]);
} }
} }