Skip to content

Commit

Permalink
fix: 修复admin_setting可能出现的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
gua committed Nov 23, 2023
1 parent 1c64660 commit 9ce30d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Models/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public function getValueAttribute($value)
// 如果值为 null,你可能想要处理这种情况,例如返回一个默认值
return null; // 或者返回你期望的默认值
}
if (!is_string($value)) {
return $value;
}

$decodedValue = json_decode($value, true);

if (json_last_error() === JSON_ERROR_NONE) {
Expand Down

0 comments on commit 9ce30d9

Please sign in to comment.