From ded753b5be9d188f4a3c7dcbba96dec64241c5e9 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 5 Sep 2020 16:08:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9banner=20=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89http?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/CategoryService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Service/v3/Implementations/CategoryService.php b/app/Service/v3/Implementations/CategoryService.php index c49de5e..b7195e2 100644 --- a/app/Service/v3/Implementations/CategoryService.php +++ b/app/Service/v3/Implementations/CategoryService.php @@ -58,7 +58,12 @@ class CategoryService implements CategoryServiceInterface $returnData = []; foreach ($categories as $key => &$category) { $value = json_decode($category, true); - $returnData[] = ['id' => $key, 'icon' => config('alioss.img_host').$value['icon'].OssThumbnail::THUMBNAIL_100_Q50, 'name' => $value['name']]; + $iconUrl = $value['icon']; + if(strripos($iconUrl,"http") === false){ + $iconUrl = config('alioss.img_host').$value['icon']; + } + $iconUrl = $iconUrl . OssThumbnail::THUMBNAIL_100_Q50; + $returnData[] = ['id' => $key, 'icon' => $iconUrl , 'name' => $value['name']]; } return $returnData;