/**
* 倒计时30s发送心跳
* */
getCode:function () {
const TIME_COUNT =30;
var that=this;
if (!that.timer) {
that.count = TIME_COUNT;
that.timer =setInterval(function () {
if (that.count >0 && that.count <= TIME_COUNT) {
that.count--;
}else {
clearInterval(that.timer);
that.timer =null;
that.getCode();
}
}, 1000)
}
},
网友评论