fix: 修复无法预览pdf文件
This commit is contained in:
parent
ea8e1e9c57
commit
c952659620
@ -275,15 +275,16 @@ class File extends AbstractModel
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 格式化内容数据
|
* 格式化内容数据
|
||||||
* @param array $data [path, ext, size, name]
|
* @param array $data [path, size, ext, name]
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function formatFileData(array $data)
|
public static function formatFileData(array $data)
|
||||||
{
|
{
|
||||||
$filePath = $data['path'];
|
$filePath = $data['path'];
|
||||||
$fileExt = $data['ext'];
|
|
||||||
$fileSize = $data['size'];
|
$fileSize = $data['size'];
|
||||||
$fileName = $data['name'];
|
$fileExt = $data['ext'];
|
||||||
|
$fileDotExt = '.' . $fileExt;
|
||||||
|
$fileName = Base::rightDelete($data['name'], $fileDotExt) . $fileDotExt;
|
||||||
$publicPath = public_path($filePath);
|
$publicPath = public_path($filePath);
|
||||||
//
|
//
|
||||||
switch ($fileExt) {
|
switch ($fileExt) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user