修改上传
This commit is contained in:
parent
1c9e98ff2a
commit
cc5805f410
@ -61,7 +61,8 @@ class CatchUpload
|
||||
$path = Filesystem::disk($this->getDriver())->putFile($this->getPath(), $file);
|
||||
|
||||
if ($path) {
|
||||
$url = self::getCloudDomain($this->getDriver()) . $path;
|
||||
|
||||
$url = self::getCloudDomain($this->getDriver()) . '/' . $this->getLocalPath($path);
|
||||
|
||||
event('attachment', [
|
||||
'path' => $path,
|
||||
@ -76,6 +77,15 @@ class CatchUpload
|
||||
throw new FailedException('Upload Failed, Try Again!');
|
||||
}
|
||||
|
||||
protected function getLocalPath($path)
|
||||
{
|
||||
if ($this->getDriver() === self::LOCAL) {
|
||||
return str_replace(root_path('public'), '', \config('filesystem.disks.local.root')) . DIRECTORY_SEPARATOR .$path;
|
||||
}
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 多文件上传
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user