fix: 修复admin_setting可能出现的问题

This commit is contained in:
xboard 2023-11-23 18:02:50 +08:00
parent 265842e7bf
commit 1fb43f2cda

View File

@ -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) {