Browse Source

Img fix

master
weigang 6 years ago
parent
commit
4cf786db4c
  1. 4
      app/Service/AttachmentService.php

4
app/Service/AttachmentService.php

@ -74,12 +74,12 @@ class AttachmentService implements AttachmentServiceInterface
public function switchImgToAliOss($path, $bucket = 'thumbnail_q50') public function switchImgToAliOss($path, $bucket = 'thumbnail_q50')
{ {
if (strpos($path, 'http') === false || strpos($path, 'https') === false) { if (strpos($path, 'http') === false || strpos($path, 'https') === false) {
$path = 'https://img.lanzulive.com/' . $path;
$path = env('IMG_HOST') . $path;
} else { } else {
$temp = explode('//', $path); $temp = explode('//', $path);
$temp = explode('/', $temp[1]); $temp = explode('/', $temp[1]);
unset($temp[0]); unset($temp[0]);
$path = 'https://img.lanzulive.com/' . implode('/', $temp);
$path = env('IMG_HOST') . implode('/', $temp);
} }
return $path . '!' . $bucket; return $path . '!' . $bucket;
} }
Loading…
Cancel
Save