countTime() {
var that = this;
setInterval(() => {
// setTimeout是自带清除定时器
setTimeout(function () {
var url = baseUrl() + "/info/list?page=" + that.pagination.page + "&size=" + that.pagination.rowsPerPage
axios.get(url).then(function (res) {
that.data = res.data.data.records
});
}, 600)
}, 60000 * 1) //1分钟刷新一次
},
mounted() {
this.countTime()
},
定时访问接口
最新推荐文章于 2024-11-28 15:32:35 发布