Commit 925feb87 by 高淑倩

合并生产_请重新授权

parent 4569b342
......@@ -47,65 +47,59 @@ class WXService extends Http {
this.setPageLoadStatus()
wx.hideLoading()
}).catch(res => {
// if (res.msg && res.msg.indexOf('未登录') > -1) {
// // 判断是否登陆过 登陆过 重新登陆 未登陆 跳转首页
// const baseUserInfo = this.getBaseUserInfo()
// if(!baseUserInfo) {
// wxService.router('/pages/userCenter/userCenter').replace()
// return false
// }
// // 条件限制 getUserInfoLimitCount:重试次数
// if (!this.getUserInfoLimitCount) {
// this.getUserInfoLimitCount = 1
// } else {
// this.getUserInfoLimitCount++
// }
// if (this.getUserInfoLimitCount > 3) {
// wx.showToast({
// title: '登录超出重试次数!',
// icon: 'none'
// })
// wxService.router(`/pages/userCenter/userCenter`).replace()
// return false
// } else {
// // 重新登陆 更新缓存
// this.reLogin()
// }
// setTimeout(()=>{
// const pages = getCurrentPages()
// const perpage = pages[pages.length - 1]
// perpage.onShow()
// },2000)
// }
if (res.msg && res.msg.indexOf('未登录') > -1) {
// 判断是否登陆过 登陆过 重新登陆 未登陆 跳转首页
const baseUserInfo = this.getBaseUserInfo()
if(!baseUserInfo) {
wxService.router('/pages/userCenter/userCenter').replace()
return false
}
// 条件限制 getUserInfoLimitCount:重试次数
if (!this.getUserInfoLimitCount) {
this.getUserInfoLimitCount = 1
} else {
this.getUserInfoLimitCount++
}
console.log('count', this.getUserInfoLimitCount)
if (this.getUserInfoLimitCount > 3) {
wx.showToast({
title: '登录超出重试次数!',
icon: 'none'
title: '会员系统异常,请联系管理员',
icon: 'none',
duration: 2000
})
wxService.router(`/pages/userCenter/userCenter`).replace()
return false
} else {
// 重新登陆 更新缓存
this.reLogin()
}
setTimeout(()=>{
const pages = getCurrentPages()
const perpage = pages[pages.length - 1]
perpage.onShow()
},2000)
} else if (res.state === 402) {
return this.getUserInfo().then(() => {
if (!this.getUserInfoLimitCount) {
this.getUserInfoLimitCount = 1
} else {
this.getUserInfoLimitCount++
}
if (this.getUserInfoLimitCount > 3) {
wx.showToast({
title: '会员系统异常,请联系管理员',
icon: 'none'
})
} else {
this.request({
url,
data,
header: {
'buyer-token': this.getToken()
},
method,
dataType,
responseType,
success,
fail,
complete
})
}
})
} else if(res.msg && res.msg.indexOf('请重新授权') > -1) {
wx.setStorageSync('reLoginErr', true)
// wxService.router(`/pages/userCenter/userCenter`).replace()
console.log("授权跳转")
wxService.router(`/pages/userCenter/userCenter`).back()
}
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment