wiz-frameworks
Version:
wizlong react framework
28 lines (25 loc) • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
/**
* 根据类型确定文件归档文件夹
*/
var getCustomDirByType = function getCustomDirByType(type) {
var t = 'other/';
if (new RegExp("image/.*").test(type)) {
t = 'picture/';
} else if (new RegExp("audio/.*|video/.*").test(type)) {
t = 'media/';
} else if (new RegExp("application/msword|application/vnd.openxmlformatsofficedocument.wordprocessingml.document|application/vnd.openxmlformats-officedocument.wordprocessingml.document").test(type)) {
t = 'doc/';
} else if (new RegExp("application/vnd.msexcel|application/vnd.openxmlformatsofficedocument.spreadsheetml.sheet|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|application/vnd.ms-excel").test(type)) {
t = 'excel/';
} else if (new RegExp("application/vnd.ms-powerpoint|application/vnd.mspowerpoint|application/vnd.openxmlformatsofficedocument.presentationml.presentation").test(type)) {
t = 'ppt/';
} else if (new RegExp("application/pdf").test(type)) {
t = 'pdf/';
}
return t;
};
exports.getCustomDirByType = getCustomDirByType;