From da77b81403939a043c469abd1a6c222f6358ebbc Mon Sep 17 00:00:00 2001 From: Ge Hao Date: Tue, 6 Dec 2016 20:52:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E6=98=AF=E6=9C=89=20bug=20=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=20redirect=EF=BC=8C=E4=BD=BF=E7=94=A8showModal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index a6e7579..7fa34bb 100644 --- a/app.js +++ b/app.js @@ -60,8 +60,18 @@ App({ if (!that.globalData.token) { var token = wx.getStorageSync('userToken') if (!token) { - wx.redirectTo({ - url: '../mine/mine' + wx.showModal({ + title: '未登录', + content: '请前往 “我的” 页面绑定手机号', + showCancel: false, + success: function(res) { + // 清除没用的token + wx.removeStorage({key: 'userToken'}) + that.globalData.token = undefined + if (getCurrentPages().length > 1) { + wx.navigateBack() + } + } }) return }