/**
* kevin 2021/1/4
* @description el-upload + accept限制上传的文件格式
* @param e 校验的类型
* @returns {string | null}
*/
export function acceptFile(e) {
const allowHook = {
video: ‘.mp4, .ogv, .ogg, .webm‘,
audio: ‘.wav, .mp3, .ogg, .acc, .webm, .amr‘,
file: ‘doc,.docx,.xlsx,.xls,.pdf‘,
excel: ‘xlsx,.xls‘,
img: ‘.jpg, .jpeg, .png, .gif‘
}
if (e) {
return allowHook[e]
}
let srt = null
for (const k in allowHook) {
srt += allowHook[k]
}
return srt
}