From 1fb43f2cda797a85fe65d953c50eff18cb64f6e6 Mon Sep 17 00:00:00 2001 From: xboard Date: Thu, 23 Nov 2023 18:02:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dadmin=5Fsetting?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=87=BA=E7=8E=B0=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/Models/Setting.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Models/Setting.php b/app/Models/Setting.php index c125603..19abbbd 100644 --- a/app/Models/Setting.php +++ b/app/Models/Setting.php @@ -15,6 +15,10 @@ class Setting extends Model // 如果值为 null,你可能想要处理这种情况,例如返回一个默认值 return null; // 或者返回你期望的默认值 } + if (!is_string($value)) { + return $value; + } + $decodedValue = json_decode($value, true); if (json_last_error() === JSON_ERROR_NONE) {