fix office file ext

This commit is contained in:
kuaifan 2021-12-13 13:06:10 +08:00
parent f1d87cfbb2
commit c36b10a416

View File

@ -143,6 +143,14 @@ class FileController extends AbstractController
])) {
return Base::retError('类型错误');
}
$ext = '';
if (in_array($type, [
'word',
'excel',
'ppt',
])) {
$ext = str_replace(['word', 'excel', 'ppt'], ['docx', 'xlsx', 'pptx'], $type);
}
//
$userid = $user->userid;
if ($pid > 0) {
@ -161,6 +169,7 @@ class FileController extends AbstractController
'pid' => $pid,
'name' => $name,
'type' => $type,
'ext' => $ext,
'userid' => $userid,
'created_id' => $user->userid,
]);
@ -201,6 +210,7 @@ class FileController extends AbstractController
'pid' => $row->pid,
'name' => $name,
'type' => $row->type,
'ext' => $row->ext,
'userid' => $userid,
'created_id' => $user->userid,
]);