Commit 925feb87 by 高淑倩

合并生产_请重新授权

parent 4569b342
...@@ -47,65 +47,59 @@ class WXService extends Http { ...@@ -47,65 +47,59 @@ class WXService extends Http {
this.setPageLoadStatus() this.setPageLoadStatus()
wx.hideLoading() wx.hideLoading()
}).catch(res => { }).catch(res => {
if (res.msg && res.msg.indexOf('未登录') > -1) { // if (res.msg && res.msg.indexOf('未登录') > -1) {
// 判断是否登陆过 登陆过 重新登陆 未登陆 跳转首页 // // 判断是否登陆过 登陆过 重新登陆 未登陆 跳转首页
const baseUserInfo = this.getBaseUserInfo() // const baseUserInfo = this.getBaseUserInfo()
if(!baseUserInfo) { // if(!baseUserInfo) {
wxService.router('/pages/userCenter/userCenter').replace() // wxService.router('/pages/userCenter/userCenter').replace()
return false // return false
} // }
// 条件限制 getUserInfoLimitCount:重试次数 // // 条件限制 getUserInfoLimitCount:重试次数
if (!this.getUserInfoLimitCount) { // if (!this.getUserInfoLimitCount) {
this.getUserInfoLimitCount = 1 // this.getUserInfoLimitCount = 1
} else { // } else {
this.getUserInfoLimitCount++ // this.getUserInfoLimitCount++
} // }
if (this.getUserInfoLimitCount > 3) { // if (this.getUserInfoLimitCount > 3) {
wx.showToast({ // wx.showToast({
title: '登录超出重试次数!', // title: '登录超出重试次数!',
icon: 'none' // icon: 'none'
}) // })
wxService.router(`/pages/userCenter/userCenter`).replace() // wxService.router(`/pages/userCenter/userCenter`).replace()
return false // return false
} else { // } else {
// 重新登陆 更新缓存 // // 重新登陆 更新缓存
this.reLogin() // this.reLogin()
} // }
setTimeout(()=>{ // setTimeout(()=>{
const pages = getCurrentPages() // const pages = getCurrentPages()
const perpage = pages[pages.length - 1] // const perpage = pages[pages.length - 1]
perpage.onShow() // perpage.onShow()
},2000) // },2000)
} else if (res.state === 402) { // }
return this.getUserInfo().then(() => { if (res.msg && res.msg.indexOf('未登录') > -1) {
if (!this.getUserInfoLimitCount) { if (!this.getUserInfoLimitCount) {
this.getUserInfoLimitCount = 1 this.getUserInfoLimitCount = 1
} else { } else {
this.getUserInfoLimitCount++ this.getUserInfoLimitCount++
} }
console.log('count', this.getUserInfoLimitCount)
if (this.getUserInfoLimitCount > 3) { if (this.getUserInfoLimitCount > 3) {
wx.showToast({ wx.showToast({
title: '会员系统异常,请联系管理员', title: '会员系统异常,请联系管理员',
icon: 'none' icon: 'none',
duration: 2000
}) })
} else { } else {
this.request({ this.reLogin()
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