mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +00:00
fix: 修复打开pdf因为文件名内容出错的问题
This commit is contained in:
parent
a48a1210c8
commit
7d48f9bde5
@ -343,8 +343,6 @@ class File extends AbstractModel
|
|||||||
$filePath = $data['path'];
|
$filePath = $data['path'];
|
||||||
$fileSize = $data['size'];
|
$fileSize = $data['size'];
|
||||||
$fileExt = $data['ext'];
|
$fileExt = $data['ext'];
|
||||||
$fileDotExt = '.' . $fileExt;
|
|
||||||
$fileName = Base::rightDelete($data['name'], $fileDotExt) . $fileDotExt;
|
|
||||||
$publicPath = public_path($filePath);
|
$publicPath = public_path($filePath);
|
||||||
//
|
//
|
||||||
switch ($fileExt) {
|
switch ($fileExt) {
|
||||||
@ -393,11 +391,16 @@ class File extends AbstractModel
|
|||||||
} else {
|
} else {
|
||||||
$url = 'http://' . env('APP_IPPR') . '.3/' . $filePath;
|
$url = 'http://' . env('APP_IPPR') . '.3/' . $filePath;
|
||||||
}
|
}
|
||||||
|
if ($fileExt != 'pdf') {
|
||||||
|
$fileDotExt = ".{$fileExt}";
|
||||||
|
$fileName = Base::rightDelete($data['name'], $fileDotExt) . $fileDotExt;
|
||||||
|
$url = Base::urlAddparameter($url, [
|
||||||
|
'fullfilename' => $fileName
|
||||||
|
]);
|
||||||
|
}
|
||||||
$data['content'] = [
|
$data['content'] = [
|
||||||
'preview' => true,
|
'preview' => true,
|
||||||
'url' => base64_encode(Base::urlAddparameter($url, [
|
'url' => base64_encode($url),
|
||||||
'fullfilename' => $fileName
|
|
||||||
])),
|
|
||||||
];
|
];
|
||||||
$data['file_mode'] = 'preview';
|
$data['file_mode'] = 'preview';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user