up.
This commit is contained in:
parent
f4cf916c73
commit
b54b8a47a8
@ -51,12 +51,12 @@ class ExceptionHandle extends Handle
|
||||
public function render($request, Throwable $e): Response
|
||||
{
|
||||
// 添加自定义异常处理机制
|
||||
if ($e instanceof ValidateException) {
|
||||
return json(['code'=>400,'message'=>$e->getMessage()]);
|
||||
}
|
||||
if ($request->isJson()) {
|
||||
return json(['code'=>400,'message'=>$e->getMessage()]);
|
||||
}
|
||||
// if ($e instanceof ValidateException) {
|
||||
// return json(['code'=>400,'message'=>$e->getMessage()]);
|
||||
// }
|
||||
// if ($request->isJson()) {
|
||||
// return json(['code'=>400,'message'=>$e->getMessage()]);
|
||||
// }
|
||||
|
||||
// 其他错误交给系统处理
|
||||
return parent::render($request, $e);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user