From a528ee83aeace360208a576a794eba1b3d0cc6a5 Mon Sep 17 00:00:00 2001 From: wuyanwen Date: Sun, 19 Jan 2020 15:49:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9response=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/CatchResponse.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extend/catcher/CatchResponse.php b/extend/catcher/CatchResponse.php index 4344f41..b99e599 100644 --- a/extend/catcher/CatchResponse.php +++ b/extend/catcher/CatchResponse.php @@ -36,8 +36,8 @@ class CatchResponse public static function paginate(Paginator $list) { return json([ - 'code' => 10000, - 'msg' => 'success', + 'code' => Code::SUCCESS, + 'message' => 'success', 'count' => $list->total(), 'current' => $list->currentPage(), 'limit' => $list->listRows(), @@ -53,11 +53,11 @@ class CatchResponse * @param int $code * @return Json */ - public static function fail($msg = '', $code = 10001): Json + public static function fail($msg = '', $code = Code::FAILED): Json { return json([ - 'code' => $code, - 'msg' => $msg, + 'code' => $code, + 'message' => $msg, ]); } }