diff --git a/fangija-zsyf/js/axiosPlugin.js b/fangija-zsyf/js/axiosPlugin.js index ff4df29..b302d7b 100644 --- a/fangija-zsyf/js/axiosPlugin.js +++ b/fangija-zsyf/js/axiosPlugin.js @@ -14,26 +14,32 @@ axios.interceptors.request.use(function (config) { var showTimeOutTime = 0; // 添加响应拦截器 axios.interceptors.response.use(function (response) { - plus.nativeUI.closeWaiting(); + try { + plus.nativeUI.closeWaiting(); + }catch(e){ + + } return response; }, function (error) { - if (error.toString().indexOf('timeout') > -1) { - var curTime = new Date(); - if (curTime - showTimeOutTime > 5000) { - plus.nativeUI.alert("请求超时"); - showTimeOutTime = new Date(); - } - plus.nativeUI.closeWaiting(); - }else if(error=="Error: Network Error"){ - if(plus.webview.getWebviewById('error.html')==null){ - clicked('error.html',true,false,{},{},function(){ - window.location.reload(); - }) - }else{ - $(".loadingBg").hide(); - plus.nativeUI.closeWaiting(); - plus.webview.getWebviewById("error.html").show(); - } - } + try { + if (error.toString().indexOf('timeout') > -1) { + var curTime = new Date(); + if (curTime - showTimeOutTime > 5000) { + plus.nativeUI.alert("请求超时"); + showTimeOutTime = new Date(); + } + plus.nativeUI.closeWaiting(); + }else if(error=="Error: Network Error"){ + if(plus.webview.getWebviewById('error.html')==null){ + clicked('error.html',true,false,{},{},function(){ + window.location.reload(); + }) + }else{ + $(".loadingBg").hide(); + plus.nativeUI.closeWaiting(); + plus.webview.getWebviewById("error.html").show(); + } + } + }catch(e){} return Promise.reject(error); }); \ No newline at end of file