From 69ed879b5277d416be86817144e0be2cafc1dd1a Mon Sep 17 00:00:00 2001 From: weigang Date: Thu, 27 Aug 2020 21:12:37 +0800 Subject: [PATCH] Img fix --- app/Service/AttachmentService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Service/AttachmentService.php b/app/Service/AttachmentService.php index c576be9..9ba1e9b 100644 --- a/app/Service/AttachmentService.php +++ b/app/Service/AttachmentService.php @@ -74,12 +74,12 @@ class AttachmentService implements AttachmentServiceInterface public function switchImgToAliOss($path, $bucket = 'thumbnail_q50') { if (strpos($path, 'http') === false || strpos($path, 'https') === false) { - $path = env('IMG_HOST') . $path; + $path = env('OSS_IMG_HOST') . '/' . $path; } else { $temp = explode('//', $path); $temp = explode('/', $temp[1]); unset($temp[0]); - $path = env('IMG_HOST') . implode('/', $temp); + $path = env('OSS_IMG_HOST') . '/' . implode('/', $temp); } return $path . '!' . $bucket; }