Authored by huangyCode

503url更改

... ... @@ -33,7 +33,7 @@ App({
if (!res.screenWidth) {
res.screenWidth = res.windowWidth;
}
wx.removeStorageSync('errorFlag');
this.globalData.systemInfo = res;
this.checkUDID();
... ...
... ... @@ -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',
})
... ...
... ... @@ -3,11 +3,17 @@ Page({
},
onShow: function () {
wx.removeStorageSync('errorUrl')
},
onUnload:function(){
wx.removeStorageSync('errorFlag')
},
back: function () {
wx.navigateBack({
delta: 1
delta: 1,
success:()=>{
wx.removeStorageSync('errorFlag')
}
})
}
})
\ No newline at end of file
... ...