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; }