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