const getFileType = (filename) => {
//根据文件名返回对应文件类型
let type = "unknown";
if (!filename) return type;
let index = filename.lastIndexOf(".");
let extension = filename.substr(index + 1);
extension = extension.split('?')[0]
js根据文件名返回对应文件类型
于 2022-05-27 09:10:33 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)