修改response返回错误
This commit is contained in:
parent
d09bcba9f3
commit
a528ee83ae
@ -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,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user