Browse Source

fix: 限制二进制文件解压的类型 (#6425)

Refs #6113
pull/6428/head
2 months ago committed by GitHub
parent
commit
64bc92a7fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      frontend/src/views/host/file-management/index.vue

16
frontend/src/views/host/file-management/index.vue

@ -1097,7 +1097,7 @@ const buttons = [
label: i18n.global.t('file.deCompress'),
click: openDeCompress,
disabled: (row: File.File) => {
return row.isDir;
return !isDecompressFile(row);
},
},
{
@ -1137,6 +1137,20 @@ const buttons = [
},
];
const isDecompressFile = (row: File.File) => {
if (row.isDir) {
return false;
}
if (getFileType(row.extension) === 'compress') {
return true;
}
if (row.mimeType == 'application/octet-stream') {
return false;
} else {
return Mimetypes.get(row.mimeType) != undefined;
}
};
onMounted(() => {
if (router.currentRoute.value.query.path) {
req.path = String(router.currentRoute.value.query.path);

Loading…
Cancel
Save