>[danger]实现一个request,可以在失败的时候重试,有interval和maxCount参数 ~~~ async function request(options, interval, maxCount) { let alreadyRetryCounts = 0 let result const fetchData = async () => { await fetch(options) .then(res => result = res) .catch(() => { alreadyRetryCounts++ if (alredayRetryCounts <= maxCount) { setTimeout(fetchData, interval) } }) } await fetchData() return result } ~~~