1
0
Fork 0
develop
panliang 2023-05-08 21:34:27 +08:00
parent c4c8832a72
commit d40af05598
1 changed files with 5 additions and 5 deletions

View File

@ -44,11 +44,11 @@ class Handler extends ExceptionHandler
*/ */
public function register() public function register()
{ {
$this->renderable(function (\Symfony\Component\HttpKernel\Exception\NotFoundHttpException $e, Request $request) { // $this->renderable(function (\Symfony\Component\HttpKernel\Exception\NotFoundHttpException $e, Request $request) {
if ($request->acceptsJson()) { // if ($request->acceptsJson()) {
return response()->json(['status' => 404, 'msg' => '资源不存在', 'data' => null], 200); // return response()->json(['status' => 404, 'msg' => '资源不存在', 'data' => null], 200);
} // }
}); // });
$this->renderable(function (\Illuminate\Validation\ValidationException $e, Request $request) { $this->renderable(function (\Illuminate\Validation\ValidationException $e, Request $request) {
if ($request->acceptsJson()) { if ($request->acceptsJson()) {
$errors = $e->validator->errors(); $errors = $e->validator->errors();