增加网络超时提醒
This commit is contained in:
@@ -119,7 +119,8 @@ const getNewestAct = () => {
|
||||
networkRequest({
|
||||
type: 'GET',
|
||||
url: urlPrefix + '/act/luckySea/getNewestAct',
|
||||
success(res) {
|
||||
timeout: 8000,
|
||||
success (res) {
|
||||
if (res.code === 200) {
|
||||
if ($.isEmptyObject(res.data) || res.data.status === 4) {
|
||||
return showLoading('服務器正在維護中...')
|
||||
@@ -168,6 +169,13 @@ const getNewestAct = () => {
|
||||
},
|
||||
error(err) {
|
||||
toastMsg('網絡錯誤,請退出重進')
|
||||
},
|
||||
complete: function (XMLHttpRequest, status) {
|
||||
if (status == 'timeout') {
|
||||
xhr.abort()// 超时后中断请求
|
||||
hideLoading(layerIndex);
|
||||
toastMsg('網絡開小差,請退出重進,開獎結果可通過【遊戲記錄】/【往輪結果】查看~')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user