From 92c9774b185ea24d22e835439530b3e4f7ad4978 Mon Sep 17 00:00:00 2001 From: Dragon <13925835632@139.com> Date: Mon, 26 Feb 2024 14:32:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/peko/activity/act-guard-planet/index.html | 2 +- view/peko/activity/act-guard-planet/js/index.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/view/peko/activity/act-guard-planet/index.html b/view/peko/activity/act-guard-planet/index.html index 86b7901..6eaabf4 100644 --- a/view/peko/activity/act-guard-planet/index.html +++ b/view/peko/activity/act-guard-planet/index.html @@ -257,7 +257,7 @@ - + \ No newline at end of file diff --git a/view/peko/activity/act-guard-planet/js/index.js b/view/peko/activity/act-guard-planet/js/index.js index d1c1cc9..9f71b04 100644 --- a/view/peko/activity/act-guard-planet/js/index.js +++ b/view/peko/activity/act-guard-planet/js/index.js @@ -123,6 +123,7 @@ const getNewestAct = () => { networkRequest({ type: 'GET', url: urlPrefix + '/act/callBattle/getNewestAct', + timeout: 3000, success (res) { if (res.code === 200) { if ($.isEmptyObject(res.data) || res.data.status === 4) { @@ -172,6 +173,12 @@ const getNewestAct = () => { }, error (err) { toastMsg('網絡錯誤,請退出重進') + }, + complete: function (XMLHttpRequest, status) { + if (status == 'timeout') { + XMLHttpRequest.abort()// 超时后中断请求 + toastMsg('您當前網路異常,請退出重進~') + } } }) }