function showModel(data, content) { wx.setStorageSync('qrCodeMsg', data); wx.reLaunch({ url: '/pages/login/index', }) /* wx.showModal({ title: '提示', content: content, showCancel: false, success: (res => { if (res.confirm) }) }); */ } //解析二维码链接 function setDataUrl(url, login) { let q = url; console.log("q", q); const data = { type: q.slice(q.indexOf("type=") + 5, q.indexOf('&')), id: q.slice(q.lastIndexOf('=') + 1), name: q.slice(q.lastIndexOf('fbrand=') + 7, q.lastIndexOf('&')) } if (!wx.getStorageSync('userData').token) { return showModel(data, '当前未登录,请登录后进入!') } else if (login) { return showModel(data, '登录状态已过期,请重新登陆!') }; return data; } module.exports = { setDataUrl }