From 4293840522f4acd3d43947b7cee93a2b5cc07a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 18 Nov 2022 08:55:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BD=91=E7=BB=9C=E8=AF=B7?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/static/js/auto-update.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/resources/static/js/auto-update.js b/ruoyi-admin/src/main/resources/static/js/auto-update.js index 5fe3031..992c703 100644 --- a/ruoyi-admin/src/main/resources/static/js/auto-update.js +++ b/ruoyi-admin/src/main/resources/static/js/auto-update.js @@ -4,17 +4,21 @@ async function autoUpdate(url, interval, callback = () => {}, method = 'post') { type: method, url: url, dataType: 'json', + timeout:9000, success: function (data) { + setTimeout(() => autoUpdate(url, interval, callback, method), interval) callback(data) resolve(data) + }, error: function (reason) { + setTimeout(() => autoUpdate(url, interval, callback, method), interval) console.error(reason) reject(reason) } }) }) - setTimeout(() => autoUpdate(url, interval, callback, method), interval) + } const INTERVAL = 10000