From 9a487d18c3a1fd6b1698cb047a6b166312a7d150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AF=E4=B9=90=E5=8A=A0=E5=86=B0?= <11869599+addie66@user.noreply.gitee.com> Date: Fri, 2 Oct 2026 15:33:23 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(shopro=5Fhuifu):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=B1=87=E4=BB=98=E8=BF=9B=E4=BB=B6=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在submitFromDraft方法中添加HttpResponseException捕获并重新抛出 - 在resubmit方法中添加HttpResponseException捕获并重新抛出 - 改进错误消息显示,当异常消息为空时显示默认提示 - 调整代码结构确保成功消息在正确位置返回 ``` --- .../admin/controller/shopro_huifu/Onboard.php | 12 ++++++++---- .../admin/controller/shopro_huifu/Onboard.php | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/addons/shopro_huifu/application/admin/controller/shopro_huifu/Onboard.php b/addons/shopro_huifu/application/admin/controller/shopro_huifu/Onboard.php index 45220f8..f7497d1 100644 --- a/addons/shopro_huifu/application/admin/controller/shopro_huifu/Onboard.php +++ b/addons/shopro_huifu/application/admin/controller/shopro_huifu/Onboard.php @@ -73,10 +73,12 @@ class Onboard extends Base try { $service = new HuifuOnboardService(); $service->submitFromDraft($row['user_id'], $row['role_type'], $row['role_ref_id']); - $this->success('已提交汇付进件'); + } catch (\think\exception\HttpResponseException $e) { + throw $e; } catch (\Throwable $e) { - $this->error($e->getMessage()); + $this->error($e->getMessage() ?: '提交汇付进件失败'); } + $this->success('已提交汇付进件'); } public function add() @@ -178,9 +180,11 @@ class Onboard extends Base try { $service = new HuifuOnboardService(); $service->resubmit($row['user_id'], $row['role_type'], $row['role_ref_id'], $payload); - $this->success('已重新提交进件'); + } catch (\think\exception\HttpResponseException $e) { + throw $e; } catch (\Throwable $e) { - $this->error($e->getMessage()); + $this->error($e->getMessage() ?: '重新提交进件失败'); } + $this->success('已重新提交进件'); } } diff --git a/application/admin/controller/shopro_huifu/Onboard.php b/application/admin/controller/shopro_huifu/Onboard.php index 723013f..65c7fc8 100644 --- a/application/admin/controller/shopro_huifu/Onboard.php +++ b/application/admin/controller/shopro_huifu/Onboard.php @@ -75,10 +75,12 @@ class Onboard extends Base try { $service = new HuifuOnboardService(); $service->submitFromDraft($row['user_id'], $row['role_type'], $row['role_ref_id']); - $this->success('已提交汇付进件'); + } catch (\think\exception\HttpResponseException $e) { + throw $e; } catch (\Throwable $e) { - $this->error($e->getMessage()); + $this->error($e->getMessage() ?: '提交汇付进件失败'); } + $this->success('已提交汇付进件'); } public function add() @@ -180,9 +182,11 @@ class Onboard extends Base try { $service = new HuifuOnboardService(); $service->resubmit($row['user_id'], $row['role_type'], $row['role_ref_id'], $payload); - $this->success('已重新提交进件'); + } catch (\think\exception\HttpResponseException $e) { + throw $e; } catch (\Throwable $e) { - $this->error($e->getMessage()); + $this->error($e->getMessage() ?: '重新提交进件失败'); } + $this->success('已重新提交进件'); } }