在涉及文件上传、预览等功能时,统一封装文件处理函数可以简化开发流程。// 判断是否为图片文件functionisImage(filename){constimageExtensions=['jpg','jpeg','png','gif','bmp','webp'