From 6475df1d71cd49a3c382fc74fdf477c9b94d5fd9 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Mon, 17 Mar 2025 15:33:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E7=89=87=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/BaseModel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common/model/BaseModel.php b/app/common/model/BaseModel.php index abc9c72c..fe0323bd 100644 --- a/app/common/model/BaseModel.php +++ b/app/common/model/BaseModel.php @@ -18,7 +18,7 @@ class BaseModel extends Model */ public function getImageAttr($value) { - return trim($value) ? FileService::getFileUrl($value) : ''; + return empty($value) ? '' : (trim($value) ? FileService::getFileUrl($value) : ''); } /** @@ -30,7 +30,7 @@ class BaseModel extends Model */ public function setImageAttr($value) { - return trim($value) ? FileService::setFileUrl($value) : ''; + return empty($value) ? '' : (trim($value) ? FileService::setFileUrl($value) : ''); } /**