From c952659620150ff8c3469c954916861c144cf59c Mon Sep 17 00:00:00 2001 From: kuaifan Date: Fri, 25 Feb 2022 22:14:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E9=A2=84=E8=A7=88pdf=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/File.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Models/File.php b/app/Models/File.php index c5e9b84af..85ff695ba 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -275,15 +275,16 @@ class File extends AbstractModel /** * 格式化内容数据 - * @param array $data [path, ext, size, name] + * @param array $data [path, size, ext, name] * @return array */ public static function formatFileData(array $data) { $filePath = $data['path']; - $fileExt = $data['ext']; $fileSize = $data['size']; - $fileName = $data['name']; + $fileExt = $data['ext']; + $fileDotExt = '.' . $fileExt; + $fileName = Base::rightDelete($data['name'], $fileDotExt) . $fileDotExt; $publicPath = public_path($filePath); // switch ($fileExt) {