11 2020 档案
摘要:/* 缓存加载函数 cacheLen:最多缓存多少个接口 id:唯一值 name:方法名 syncFunc:加载函数 */ // 缓存最近的20个接口 const methodCacheArr = [] let cacheLen = 20 try { const arr=JSON.parse(loc
阅读全文
摘要:/* 并发加载函数 id:唯一值 syncFunc:加载函数 */ const _map={} async function conCurentLoad (id,syncFunc) { //兼容并发加载的情况 if(!_map[id]){ _map[id]=[]; const res = await
阅读全文