在实际项目中我们经常需要实现轮询-每隔一段时间请求一次接口刷新数据
window.setInterval(() => {
setTimeout(() => {
///调取接口
}, 0)
}, 30000)
具体秒数看需求而设定,这里先设定30秒(setTimeout是自带清除定时器)
在实际项目中我们经常需要实现轮询-每隔一段时间请求一次接口刷新数据
window.setInterval(() => {
setTimeout(() => {
///调取接口
}, 0)
}, 30000)
具体秒数看需求而设定,这里先设定30秒(setTimeout是自带清除定时器)
最新评论
我这边UI界面用React重写了,地址是 https://vps.kkwen.cn,有需要可以提供给你
Thankfulness to my father who told me concerning this webpage, this web site is genuinely remarkable