From 33f6df8d03b704ab241ed845c03425d41cfb4746 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Fri, 24 May 2024 17:18:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=81=E5=85=89=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=B6=88=E6=81=AF=E5=8F=91=E9=80=81=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/JgPushService.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/common/service/JgPushService.php b/app/common/service/JgPushService.php index e96f8a2..8b4054f 100644 --- a/app/common/service/JgPushService.php +++ b/app/common/service/JgPushService.php @@ -27,6 +27,7 @@ } public function sendMsg($register_id,$message,$route = '',$type = 1){ + $res = true; try { $this->client = new Client($this->iosKey, $this->iosSecret); $this->push = $this->client->push(); @@ -35,10 +36,9 @@ $this->push->iosNotification($message, ['extras' => ['route' => $route, 'type' => $type]]); $this->push->send(); unset($this->client, $this->push); - return true; } catch (\Exception $e) { Log::error($e->getMessage()); - return $e->getMessage(); + $res = false; } try { $this->client = new Client($this->azKey, $this->azSecret); @@ -48,11 +48,11 @@ $this->push->androidNotification($message, ['extras' => ['route' => $route, 'type' => $type]]); $this->push->send(); unset($this->client, $this->push); - return true; + $res = true; } catch (\Exception $e) { Log::error($e->getMessage()); - return $e->getMessage(); - + $res = false; } + return $res; } } \ No newline at end of file