|
@@ -134,21 +134,14 @@ function request(method = 'GET') { |
|
@@ -134,21 +134,14 @@ function request(method = 'GET') { |
134
|
}
|
134
|
}
|
135
|
});
|
135
|
});
|
136
|
}
|
136
|
}
|
137
|
- let pages = getCurrentPages() //获取加载的页面
|
|
|
138
|
- let currentPage = pages[pages.length-1] //获取当前页面的对象
|
|
|
139
|
- let url = currentPage.route //当前页面url
|
|
|
140
|
- let errorUrl = wx.getStorageSync('errorUrl') || '';
|
|
|
141
|
if (statusCode == 200) {
|
137
|
if (statusCode == 200) {
|
142
|
- if(errorUrl && errorUrl !== url){
|
|
|
143
|
- wx.removeStorageSync('errorUrl');
|
|
|
144
|
- }
|
|
|
145
|
resolve(data);
|
138
|
resolve(data);
|
146
|
} else {
|
139
|
} else {
|
147
|
let code = statusCode;
|
140
|
let code = statusCode;
|
148
|
let message = res.errMsg ? res.errMsg : '';
|
141
|
let message = res.errMsg ? res.errMsg : '';
|
149
|
if(statusCode === 503) {
|
142
|
if(statusCode === 503) {
|
150
|
- if(errorUrl !== url) {
|
|
|
151
|
- wx.setStorageSync('errorUrl',url);
|
143
|
+ if(!wx.getStorageSync('errorFlag')) {
|
|
|
144
|
+ wx.setStorageSync('errorFlag',true);
|
152
|
wx.navigateTo({
|
145
|
wx.navigateTo({
|
153
|
url: '/pages/zeroSell/error',
|
146
|
url: '/pages/zeroSell/error',
|
154
|
})
|
147
|
})
|
|
@@ -248,21 +241,14 @@ function request(method = 'GET') { |
|
@@ -248,21 +241,14 @@ function request(method = 'GET') { |
248
|
}
|
241
|
}
|
249
|
});
|
242
|
});
|
250
|
}
|
243
|
}
|
251
|
- let pages = getCurrentPages() //获取加载的页面
|
|
|
252
|
- let currentPage = pages[pages.length-1] //获取当前页面的对象
|
|
|
253
|
- let url = currentPage.route //当前页面url
|
|
|
254
|
- let errorUrl = wx.getStorageSync('errorUrl') || '';
|
|
|
255
|
if (statusCode == 200) {
|
244
|
if (statusCode == 200) {
|
256
|
- if(errorUrl && errorUrl !== url){
|
|
|
257
|
- wx.removeStorageSync('errorUrl');
|
|
|
258
|
- }
|
|
|
259
|
resolve(data);
|
245
|
resolve(data);
|
260
|
} else {
|
246
|
} else {
|
261
|
let code = statusCode;
|
247
|
let code = statusCode;
|
262
|
let message = res.errMsg ? res.errMsg : '';
|
248
|
let message = res.errMsg ? res.errMsg : '';
|
263
|
if(statusCode === 503) {
|
249
|
if(statusCode === 503) {
|
264
|
- if(errorUrl !== url){
|
|
|
265
|
- wx.setStorageSync('errorUrl',url);
|
250
|
+ if(!wx.getStorageSync('errorFlag')) {
|
|
|
251
|
+ wx.setStorageSync('errorFlag',true);
|
266
|
wx.navigateTo({
|
252
|
wx.navigateTo({
|
267
|
url: '/pages/zeroSell/error',
|
253
|
url: '/pages/zeroSell/error',
|
268
|
})
|
254
|
})
|