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