新增接口超时问题
This commit is contained in:
@@ -257,7 +257,7 @@
|
||||
<script src="../../common/js/vconsole.min.js"></script>
|
||||
<script src="../../common/js/svga.min.js"></script>
|
||||
<script src="../../common/js/route-constant.js"></script>
|
||||
<script src="./js/index.js?v=2.6"></script>
|
||||
<script src="./js/index.js?v=2.7"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -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('您當前網路異常,請退出重進~')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user