case 401: let pages = getCurrentPages() wx.setStorageSync('before_login_page', pages[0].route) wx.setStorageSync('before_login_page_options', pages[0].options) wx.reLaunch({ url: '/pages/login/login', }) break;
let lastpage = wx.getStorageSync('before_login_page') let lastpageoption = wx.getStorageSync('before_login_page_options') if (lastpage) { lastpage = '/' + lastpage wx.setStorageSync('before_login_page', undefined) wx.setStorageSync('before_login_page_options', undefined) let tabarr = ['/pages/index/index', '/pages/mine/mine'] let suburl = '' for (const key in lastpageoption) { if (key) { suburl += `&${key}=${lastpageoption[key]}` } } if (suburl) { suburl = suburl.replace('&', '?') } let jumppage = lastpage + suburl if (tabarr.indexOf(lastpage) == -1) { wx.navigateTo({ url: jumppage, }) } else { wx.switchTab({ url: jumppage, }) } } else { wx.switchTab({ url: '/pages/index/index', }) }
标签:返回,lastpage,token,suburl,before,login,页面,pages,wx From: https://www.cnblogs.com/jqynr/p/17039312.html