|
@@ -5,15 +5,17 @@ module.exports.fileList = function fileList(list) {
|
|
|
word: ['doc', 'docx'],
|
|
|
excel: ['xls', 'xlsx'],
|
|
|
ppt: ['ppt', 'pptx'],
|
|
|
- txt: ['txt'],
|
|
|
+ txt: ['txt','md','js','json'],
|
|
|
pdf: ['pdf'],
|
|
|
rar: ['7z', 'zip', 'rar', 'kz', 'ace', 'arj', 'bz2', 'cab', 'gz', 'iso', 'jar', 'lzh', 'tar', 'z'],
|
|
|
folder: ['"folder"']
|
|
|
},
|
|
|
typeList = [];
|
|
|
for (let key in suffixList) typeList.push(key);
|
|
|
-
|
|
|
+
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
+ list[i].fileType = 'unknown';
|
|
|
+ list[i].cover = `/static/image/file/unknown.png`
|
|
|
const suffix = list[i].postfix;
|
|
|
if (suffix != "folder") {
|
|
|
for (var key in suffixList) {
|
|
@@ -27,8 +29,8 @@ module.exports.fileList = function fileList(list) {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- list[i].fileType = suffix == "folder" ? 'folder' : 'unknown';
|
|
|
- list[i].cover = suffix == "folder" ? '/static/image/file/folder.png' : '/static/image/file/unknown.png';
|
|
|
+ list[i].fileType = "folder";
|
|
|
+ list[i].cover = `/static/image/file/folder.png`
|
|
|
}
|
|
|
}
|
|
|
return list;
|