From 65d3111e6541c784c5459dd11f0e5b1bdf6c2ac4 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Wed, 20 Jan 2021 20:09:06 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=E4=BF=AE=E5=A4=8Doss=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/CatchUpload.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/extend/catcher/CatchUpload.php b/extend/catcher/CatchUpload.php index 1ce64e2..a195267 100644 --- a/extend/catcher/CatchUpload.php +++ b/extend/catcher/CatchUpload.php @@ -336,11 +336,27 @@ class CatchUpload case CatchUpload::LOCAL: return $driver['domain']; case CatchUpload::OSS: - return $driver['end_point']; + return self::getOssDomain(); case CatchUpload::QCLOUD: return $driver['cdn']; default: throw new FailedException(sprintf('Driver [%s] Not Supported.', $driver)); } } + + /** + * 获取 OSS Domain + * + * @time 2021年01月20日 + * @return mixed|string + */ + protected static function getOssDomain(): string + { + $oss = \config('filesystem.disks.oss'); + if ($oss['is_cname'] === false) { + return 'https://' . $oss['bucket'] . '.' . $oss['end_point']; + } + + return $oss['end_point']; + } } \ No newline at end of file