From 072241ed14171829bb6c60be9dce48cb6051ebeb Mon Sep 17 00:00:00 2001 From: binbin0314 Date: Thu, 29 Jul 2021 18:40:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index e1638e7..7150e76 100644 --- a/index.html +++ b/index.html @@ -41,6 +41,7 @@ projectId: '', dom: '', name: 'pluginNotice', + timer: null, init() { this.dom = document.querySelector("div[data-root=p1419895620596146176]"); var domBox = this.dom.parentNode; @@ -63,9 +64,9 @@ const { success, code, data, msg } = res; if (success && code === 200) { that.token = data.token; - setInterval(function (){ + that.timer = setInterval(function (){ //查询当前项目的最新消息 - that.getFirstAidRecord() + that.getFirstAidRecord() },3000) } else { alert(msg || '获取失败') @@ -93,6 +94,10 @@ return response.json(); }).catch(function(error){ console.error('Error:', error) + // TODO: 测试数据 + that.setDate('请张小小3号窗口交费') + clearInterval(that.timer) + // TODO }).then(function(res){ const { success, code, data, msg } = res; if (success && code === 200) {