add
This commit is contained in:
@@ -11,7 +11,6 @@ axios.interceptors.request.use(function (config) {
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
var showTimeOutTime = 0;
|
||||
// 添加响应拦截器
|
||||
axios.interceptors.response.use(function (response) {
|
||||
try {
|
||||
@@ -22,14 +21,7 @@ axios.interceptors.response.use(function (response) {
|
||||
return response;
|
||||
}, function (error) {
|
||||
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(error=="Error: Network Error" || error.toString().indexOf('timeout') > -1){
|
||||
if(plus.webview.getWebviewById('error.html')==null){
|
||||
clicked('error.html',true,false,{},{},function(){
|
||||
window.location.reload();
|
||||
|
||||
Reference in New Issue
Block a user