自动请求工具
按周期执行请求,暂时只支持get/post
npm i autorq || cnpm i autorq || pnpm i autorq
import autorq from 'autorq';
autorq( [ { method: 'get', url:"https://xxxx", data:{}, time:1000 }, ] );
// 带日志
autorq([ { method: 'get', url:"https://xxxx", data:{}, time:1000,name:'x请求' }, ], (cnt, name) => {
console.log(`第${++cnt}次执行:${name}`);
});