还是有 bug 不能 redirect,使用showModal

wechat_user_type
Ge Hao 8 years ago
parent 4ebc9e7cd8
commit da77b81403
  1. 14
      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
}

Loading…
Cancel
Save