// 获取文件后缀 www.xxx.doc 返回doc
export const getUrlExt = (url) => {
const index = url.lastIndexOf('.');
let ext
if(url.indexOf('?') > -1){
ext = url.slice(index + 1, url.indexOf('?'))
}else{
ext = url.slice(index + 1, url.length)
}
return ext.toLowerCase(); // 转换为小写,确保准确性
}
获取文件后缀 www.xxx.doc 返回doc
于 2024-05-30 10:41:07 首次发布