...
|
...
|
@@ -134,21 +134,14 @@ function request(method = 'GET') { |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
let pages = getCurrentPages() //获取加载的页面
|
|
|
let currentPage = pages[pages.length-1] //获取当前页面的对象
|
|
|
let url = currentPage.route //当前页面url
|
|
|
let errorUrl = wx.getStorageSync('errorUrl') || '';
|
|
|
if (statusCode == 200) {
|
|
|
if(errorUrl && errorUrl !== url){
|
|
|
wx.removeStorageSync('errorUrl');
|
|
|
}
|
|
|
resolve(data);
|
|
|
} else {
|
|
|
let code = statusCode;
|
|
|
let message = res.errMsg ? res.errMsg : '';
|
|
|
if(statusCode === 503) {
|
|
|
if(errorUrl !== url) {
|
|
|
wx.setStorageSync('errorUrl',url);
|
|
|
if(!wx.getStorageSync('errorFlag')) {
|
|
|
wx.setStorageSync('errorFlag',true);
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/zeroSell/error',
|
|
|
})
|
...
|
...
|
@@ -248,21 +241,14 @@ function request(method = 'GET') { |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
let pages = getCurrentPages() //获取加载的页面
|
|
|
let currentPage = pages[pages.length-1] //获取当前页面的对象
|
|
|
let url = currentPage.route //当前页面url
|
|
|
let errorUrl = wx.getStorageSync('errorUrl') || '';
|
|
|
if (statusCode == 200) {
|
|
|
if(errorUrl && errorUrl !== url){
|
|
|
wx.removeStorageSync('errorUrl');
|
|
|
}
|
|
|
resolve(data);
|
|
|
} else {
|
|
|
let code = statusCode;
|
|
|
let message = res.errMsg ? res.errMsg : '';
|
|
|
if(statusCode === 503) {
|
|
|
if(errorUrl !== url){
|
|
|
wx.setStorageSync('errorUrl',url);
|
|
|
if(!wx.getStorageSync('errorFlag')) {
|
|
|
wx.setStorageSync('errorFlag',true);
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/zeroSell/error',
|
|
|
})
|
...
|
...
|
|