From edfb32647b3d7de9c0162a77c2b7b4d30d97be34 Mon Sep 17 00:00:00 2001 From: weifashi <605403358@qq.com> Date: Mon, 5 Jun 2023 19:03:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E5=8A=A0=E5=AF=86bug?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Middleware/WebApi.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Middleware/WebApi.php b/app/Http/Middleware/WebApi.php index 2f61c6971..c81a5594e 100644 --- a/app/Http/Middleware/WebApi.php +++ b/app/Http/Middleware/WebApi.php @@ -52,9 +52,10 @@ class WebApi // 加密返回内容 if ($encrypt['client_type'] === 'pgp' && $content = $response->getContent()) { - $response->setContent(json_encode([ - 'encrypted' => Doo::pgpEncryptApi($content, $encrypt['client_key']) - ])); + $content = Doo::pgpEncryptApi($content, $encrypt['client_key']); + if($content){ + $response->setContent(json_encode([ 'encrypted' => $content ])); + } } return $response;