fixed 附件本地删除

This commit is contained in:
JaguarJack 2021-05-08 07:32:09 +08:00
parent c40b03a222
commit f44f646878

View File

@ -77,8 +77,8 @@ class Attachments extends CatchModel
if ($attachment->delete()) { if ($attachment->delete()) {
if ($attachment->driver == 'local') { if ($attachment->driver == 'local') {
$localPath = config('filesystem.disks.local.root') . DIRECTORY_SEPARATOR; $localPath = config('filesystem.disks.local.root') . DIRECTORY_SEPARATOR;
$path = $localPath . str_replace('\\','\/', $attachment->path); $path = str_replace('\\','\/', $attachment->path);
if (file_exists($path)) { if (file_exists($localPath . $path)) {
Filesystem::delete($path); Filesystem::delete($path);
} }
} else { } else {