From e5fa76487333a9e103f6a17d4caea333d8509390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com> Date: Tue, 18 Jul 2023 03:28:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=97=B6=E5=8F=AF=E8=83=BD=E6=8A=A5=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/library/module/Server.php | 2 +- extend/ba/Exception.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/library/module/Server.php b/app/admin/library/module/Server.php index 92121074..d7828a44 100644 --- a/app/admin/library/module/Server.php +++ b/app/admin/library/module/Server.php @@ -40,7 +40,7 @@ class Server } if (str_starts_with($content, '{')) { $json = (array)json_decode($content, true); - throw new Exception($json['msg'], $json['code'], $json['data']); + throw new Exception($json['msg'], $json['code'], $json['data'] ?? []); } } catch (TransferException $e) { throw new Exception('package download failed', 0, ['msg' => $e->getMessage()]); diff --git a/extend/ba/Exception.php b/extend/ba/Exception.php index 3b4e1a8e..ce2edce6 100644 --- a/extend/ba/Exception.php +++ b/extend/ba/Exception.php @@ -10,7 +10,7 @@ use think\Exception as E; */ class Exception extends E { - public function __construct(protected $message, protected $code = 0, protected $data = '') + public function __construct(protected $message, protected $code = 0, protected $data = []) { parent::__construct($message, $code); }