From fb0c76606c09b81666f84bda79b3a500d3a8626b Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Mon, 27 Jul 2026 15:35:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=9A=E5=8A=A1=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/ConfigController.php | 4 +++- .../Admin/EventCalendarController.php | 4 +++- .../Admin/ParkingAttendantController.php | 8 ++++++-- .../Admin/ParkingCameraController.php | 8 ++++++-- .../Admin/ParkingElectronicMapController.php | 4 +++- .../Admin/ParkingGateControlController.php | 4 ++-- .../Admin/ParkingInformationController.php | 4 +++- .../Admin/ParkingLicensePlateController.php | 6 ++++-- .../Admin/ParkingPatternController.php | 12 +++++++++--- .../Controllers/Admin/ParkingSpaceController.php | 16 +++++++++++----- .../Admin/ParkingSpaceRepairController.php | 16 ++++++++++++---- .../Admin/ParkingWhitelistController.php | 4 +++- app/Http/Controllers/Admin/UserController.php | 12 +++++++++--- app/Http/Controllers/Admin/VipListController.php | 8 ++++++-- 14 files changed, 80 insertions(+), 30 deletions(-) diff --git a/app/Http/Controllers/Admin/ConfigController.php b/app/Http/Controllers/Admin/ConfigController.php index bec523d..c7ce9b0 100644 --- a/app/Http/Controllers/Admin/ConfigController.php +++ b/app/Http/Controllers/Admin/ConfigController.php @@ -131,8 +131,10 @@ class ConfigController extends BaseController null, __('admin.update_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.update_admin_config_failed') . ':' diff --git a/app/Http/Controllers/Admin/EventCalendarController.php b/app/Http/Controllers/Admin/EventCalendarController.php index e34adff..d8188f6 100644 --- a/app/Http/Controllers/Admin/EventCalendarController.php +++ b/app/Http/Controllers/Admin/EventCalendarController.php @@ -324,8 +324,10 @@ class EventCalendarController extends BaseController null, __('exception.event_calendar.end_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.event_calendar.end_failed') diff --git a/app/Http/Controllers/Admin/ParkingAttendantController.php b/app/Http/Controllers/Admin/ParkingAttendantController.php index b7686f3..67542c0 100644 --- a/app/Http/Controllers/Admin/ParkingAttendantController.php +++ b/app/Http/Controllers/Admin/ParkingAttendantController.php @@ -124,8 +124,10 @@ class ParkingAttendantController extends BaseController null, __('admin.save_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('admin.operation_failed') . ':' @@ -214,8 +216,10 @@ class ParkingAttendantController extends BaseController null, __('admin.update_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('admin.operation_failed') . ':' diff --git a/app/Http/Controllers/Admin/ParkingCameraController.php b/app/Http/Controllers/Admin/ParkingCameraController.php index 051f392..fd7cf32 100644 --- a/app/Http/Controllers/Admin/ParkingCameraController.php +++ b/app/Http/Controllers/Admin/ParkingCameraController.php @@ -213,8 +213,10 @@ class ParkingCameraController extends BaseController null, __('admin.save_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.parking_camera.create_failed') . ':' @@ -304,8 +306,10 @@ class ParkingCameraController extends BaseController null, __('admin.update_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.parking_camera.update_failed') . ':' diff --git a/app/Http/Controllers/Admin/ParkingElectronicMapController.php b/app/Http/Controllers/Admin/ParkingElectronicMapController.php index 4119fb7..7a65b78 100644 --- a/app/Http/Controllers/Admin/ParkingElectronicMapController.php +++ b/app/Http/Controllers/Admin/ParkingElectronicMapController.php @@ -146,8 +146,10 @@ class ParkingElectronicMapController extends BaseController $this->service->saveModel($saveData); return $this->responseService->success([], __('admin.save_succeeded')); - } catch (CustomException|ValidationException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { $m_prefix = __('admin.save_failed'); return $this->responseService->systemError( diff --git a/app/Http/Controllers/Admin/ParkingGateControlController.php b/app/Http/Controllers/Admin/ParkingGateControlController.php index f9081c0..2e1ca9b 100644 --- a/app/Http/Controllers/Admin/ParkingGateControlController.php +++ b/app/Http/Controllers/Admin/ParkingGateControlController.php @@ -213,7 +213,7 @@ class ParkingGateControlController extends BaseController ) ); } catch (CustomException $e) { - throw $e; + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.get_data_failed') . ':' . $e->getMessage() @@ -231,7 +231,7 @@ class ParkingGateControlController extends BaseController ] ); } catch (CustomException $e) { - throw $e; + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.get_data_failed') . ':' . $e->getMessage() diff --git a/app/Http/Controllers/Admin/ParkingInformationController.php b/app/Http/Controllers/Admin/ParkingInformationController.php index a514973..357585b 100644 --- a/app/Http/Controllers/Admin/ParkingInformationController.php +++ b/app/Http/Controllers/Admin/ParkingInformationController.php @@ -220,8 +220,10 @@ class ParkingInformationController extends BaseController null, __('admin.delete_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.license_plate.destroy_failed') . ':' diff --git a/app/Http/Controllers/Admin/ParkingLicensePlateController.php b/app/Http/Controllers/Admin/ParkingLicensePlateController.php index 05d5790..030db6b 100644 --- a/app/Http/Controllers/Admin/ParkingLicensePlateController.php +++ b/app/Http/Controllers/Admin/ParkingLicensePlateController.php @@ -291,8 +291,10 @@ class ParkingLicensePlateController extends BaseController return $this->responseService->success( __('controller.import.success') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_vip_list.import_failed') . ':' @@ -329,7 +331,7 @@ class ParkingLicensePlateController extends BaseController ]; return $this->responseService->success($data); } catch (CustomException $e) { - throw $e; + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('controller.license_plate.not_put') diff --git a/app/Http/Controllers/Admin/ParkingPatternController.php b/app/Http/Controllers/Admin/ParkingPatternController.php index 4caed32..bb7e17f 100644 --- a/app/Http/Controllers/Admin/ParkingPatternController.php +++ b/app/Http/Controllers/Admin/ParkingPatternController.php @@ -302,8 +302,10 @@ class ParkingPatternController extends BaseController return $this->responseService->success( __('controller.import.success') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_vip_list.import_failed') . ':' @@ -375,8 +377,10 @@ class ParkingPatternController extends BaseController return $this->responseService->success( __('controller.import.success') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_vip_list.import_failed') . ':' @@ -399,8 +403,10 @@ class ParkingPatternController extends BaseController null, __('admin.delete_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.parking_pattern.destroy_failed') . ':' diff --git a/app/Http/Controllers/Admin/ParkingSpaceController.php b/app/Http/Controllers/Admin/ParkingSpaceController.php index b12bf52..ad4d057 100644 --- a/app/Http/Controllers/Admin/ParkingSpaceController.php +++ b/app/Http/Controllers/Admin/ParkingSpaceController.php @@ -207,9 +207,11 @@ class ParkingSpaceController extends BaseController null, __('admin.update_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; - } catch (Exception $e) { + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); + } catch (Exception $e) { return $this->responseService->systemError( __('exception.parking_space.update_type_failed') . ':' . $e->getMessage() @@ -248,9 +250,11 @@ class ParkingSpaceController extends BaseController null, __('admin.update_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; - } catch (Exception $e) { + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); + } catch (Exception $e) { return $this->responseService->systemError( __('exception.parking_space.update_attr_failed') . ':' . $e->getMessage() @@ -674,8 +678,10 @@ class ParkingSpaceController extends BaseController return $this->responseService->success( __('controller.import.success') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_vip_list.import_failed') . ':' diff --git a/app/Http/Controllers/Admin/ParkingSpaceRepairController.php b/app/Http/Controllers/Admin/ParkingSpaceRepairController.php index 59e3ed5..bf095e3 100644 --- a/app/Http/Controllers/Admin/ParkingSpaceRepairController.php +++ b/app/Http/Controllers/Admin/ParkingSpaceRepairController.php @@ -258,8 +258,10 @@ class ParkingSpaceRepairController extends BaseController null, __('admin.update_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('admin.operation_failed') . ':' @@ -414,8 +416,10 @@ class ParkingSpaceRepairController extends BaseController return $this->responseService->success( __('controller.import.success') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_vip_list.import_failed') . ':' @@ -441,8 +445,10 @@ class ParkingSpaceRepairController extends BaseController null, __('admin.save_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('admin.operation_failed') . ':' @@ -514,8 +520,10 @@ class ParkingSpaceRepairController extends BaseController null, __('admin.operation_successful') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('admin.operation_failed') . ':' diff --git a/app/Http/Controllers/Admin/ParkingWhitelistController.php b/app/Http/Controllers/Admin/ParkingWhitelistController.php index 36e03cc..cbccc6c 100644 --- a/app/Http/Controllers/Admin/ParkingWhitelistController.php +++ b/app/Http/Controllers/Admin/ParkingWhitelistController.php @@ -290,8 +290,10 @@ class ParkingWhitelistController extends BaseController return $this->responseService->success( __('controller.import.success') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_vip_list.import_failed') . ':' diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index 534a22e..98c9164 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -115,8 +115,10 @@ class UserController extends BaseController null, __('admin.save_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_user.create_failed') . ':' . $e->getMessage( @@ -230,8 +232,10 @@ class UserController extends BaseController null, __('admin.update_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_user.update_failed') . ':' . $e->getMessage( @@ -254,8 +258,10 @@ class UserController extends BaseController null, __('admin.delete_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_user.destroy_failed') . ':' diff --git a/app/Http/Controllers/Admin/VipListController.php b/app/Http/Controllers/Admin/VipListController.php index d37488a..ee5a164 100644 --- a/app/Http/Controllers/Admin/VipListController.php +++ b/app/Http/Controllers/Admin/VipListController.php @@ -213,8 +213,10 @@ class VipListController extends BaseController return $this->responseService->success( __('controller.import.success') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_vip_list.import_failed') . ':' @@ -239,8 +241,10 @@ class VipListController extends BaseController null, __('admin.save_succeeded') ); - } catch (ValidationException|CustomException $e) { + } catch (ValidationException $e) { throw $e; + } catch (CustomException $e) { + return $this->responseService->businessError($e->getMessage()); } catch (Exception $e) { return $this->responseService->systemError( __('exception.admin_vip_list.create_failed') . ':'