判断文件是否为图片
function fileType(fileName) {
if (fileName.indexOf(".") !== -1) {
let urlArr = fileName.split(".") || [];
let strs = urlArr[1]
return /(png|jpeg|jpg|gif)$/i.test(strs)
}
}
判断文件是否为图片
function fileType(fileName) {
if (fileName.indexOf(".") !== -1) {
let urlArr = fileName.split(".") || [];
let strs = urlArr[1]
return /(png|jpeg|jpg|gif)$/i.test(strs)
}
}