From 2c5f7025b381bb03c097d31be7edcb1707b78451 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Fri, 28 Mar 2025 09:26:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=97=B6=E5=9B=BE=E7=89=87=E5=8F=8A=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=9C=B0=E5=9D=80=E6=8B=BC=E6=8E=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/v1/Video.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/admin/controller/v1/Video.php b/app/admin/controller/v1/Video.php index c9012d27..b311fb6c 100644 --- a/app/admin/controller/v1/Video.php +++ b/app/admin/controller/v1/Video.php @@ -229,8 +229,12 @@ class Video ->bindAttr('category', ['category_name' => 'name']) ->hidden(['category_id', 'category']) ->each(function ($item) use($domain, $image_path, $video_path) { - $item->image = $domain . $image_path . '/' . $item->image; - $item->video = $domain . $video_path . '/' . $item->video; + if (!empty($item->image)) { + $item->image = $domain . $image_path . '/' . $item->image; + } + if (!empty($item->video)) { + $item->video = $domain . $video_path . '/' . $item->video; + } $item->recommend = $item->recommend == 1 ? '是' : '否'; $item->status = $item->status == 1 ? '启用' : '禁用'; return $item;