Commit 84ab2230 84ab223098ff56d0cb011fa86a8d215f86bdf329 by lemon

*

1 parent f957b20f
......@@ -5,6 +5,7 @@ namespace App\Exceptions;
use App\Helper\ErrorCode;
use App\Helper\Response;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\ValidationException;
use Throwable;
......@@ -16,7 +17,7 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
//
ValidationException::class
];
/**
......@@ -42,5 +43,30 @@ class Handler extends ExceptionHandler
});
}
/**
* @param Throwable $e
* @throws Throwable
*/
public function report(Throwable $e)
{
parent::report($e);
}
/**
* @param \Illuminate\Http\Request $request
* @param Throwable $e
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response|\Symfony\Component\HttpFoundation\Response
* @throws Throwable
*/
public function render($request, Throwable $e)
{
if ($e instanceof ValidationException) {
Log::error(__METHOD__, ['uri'=>$request->getUri(), 'params'=> $request->all(), 'err'=>$e->errors()]);
return Response::error(ErrorCode::ILLEGAL_PARAMS, $e->validator->errors()->first());
} else {
return parent::render($request, $e); // TODO: Change the autogenerated stub
}
}
}
......
......@@ -14,5 +14,5 @@ use Illuminate\Support\Facades\Route;
*/
Route::group([], function (){
//提现审核通过
Route::post('musician/withdraw', 'MusicianWithdrawController@withdraw');
Route::get('musician/withdraw', 'MusicianWithdrawController@withdraw');
});
......