js 查找当前文件夹的文件是否存在
const imgFiles = (require as any).context("./", false, /(\.png)|(\.jpg)$/) const imgUrls: any = {} imgFiles.keys().forEach((key: string) => { const id = key.slice(2, -4) imgUrls[id] = require(`./${key.slice(2)}`) }) export default imgUrls