From ae569d2866480f28bab5bab990607de2632e9da1 Mon Sep 17 00:00:00 2001 From: mzeros Date: Sat, 7 Dec 2024 13:02:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(gateway):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=92=8C=E6=8F=90=E4=BA=A4=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=BC=82=E5=B8=B8=E6=8D=95=E8=8E=B7=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 从 query() 和 submit() 方法中删除了 try-catch 块 - 移除了异常捕获后的日志记录和错误响应逻辑 - 保留了注释掉的 try-catch 块,以便未来可能的错误处理 --- app/gateway/controller/v4/Handle.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/gateway/controller/v4/Handle.php b/app/gateway/controller/v4/Handle.php index 56c0b9d..5ffdb5f 100644 --- a/app/gateway/controller/v4/Handle.php +++ b/app/gateway/controller/v4/Handle.php @@ -18,7 +18,7 @@ class Handle extends Core # 查询接口 一般用于查询数据,同步执行 public function query(): void { - try{ + $settingStatus = sysconf('settingStatus'); if ($settingStatus == 1) { $this->no(-1000); @@ -30,17 +30,14 @@ class Handle extends Core } $data = $this->channel($this->mid, $this->product, false); $this->yes($data); - } catch (\Exception $e){ - $this->writelog($e->getMessage(), 'error'); - $this->no(-100,$e->getMessage()); - } + } # 提交接口 一般用于提交数据,异步执行 public function submit(): void { - try{ + $settingStatus = sysconf('settingStatus'); if ($settingStatus == 1) { $this->no(-1000); @@ -53,11 +50,11 @@ class Handle extends Core $data = $this->channel($this->mid, $this->product, true); $this->yes($data); - } catch (\Exception $e){ - - $this->writelog($e->getMessage(), 'error'); - $this->no(-100,$e->getMessage()); - } +// } catch (\Exception $e){ +// +// $this->writelog($e->getMessage(), 'error'); +// $this->no(-100,$e->getMessage()); +// } }