This commit is contained in:
JaguarJack
2020-09-07 08:29:12 +08:00
parent a6cebc3750
commit d533aeaa9e
6 changed files with 109 additions and 161 deletions

View File

@@ -45,7 +45,12 @@ class CatchUpload
*/
protected $path = '';
/**
public function __construct()
{
$this->initDriver();
}
/**
* upload files
*
* @param UploadedFile $file
@@ -77,6 +82,13 @@ class CatchUpload
throw new FailedException('Upload Failed, Try Again!');
}
/**
* 本地路径
*
* @time 2020年09月07日
* @param $path
* @return string
*/
protected function getLocalPath($path)
{
if ($this->getDriver() === self::LOCAL) {
@@ -296,6 +308,21 @@ class CatchUpload
}
}
/**
* 初始化
*
* @time 2020年09月07日
* @return $this
*/
protected function initDriver()
{
if ($driver = Utils::config('site.upload')) {
$this->driver = $driver;
}
return $this;
}
/**
* 获取云存储的域名
*