|
|
@ -59,6 +59,12 @@ App({ |
|
|
|
var that = this |
|
|
|
var that = this |
|
|
|
if (!that.globalData.token) { |
|
|
|
if (!that.globalData.token) { |
|
|
|
var token = wx.getStorageSync('userToken') |
|
|
|
var token = wx.getStorageSync('userToken') |
|
|
|
|
|
|
|
if (!token) { |
|
|
|
|
|
|
|
wx.redirectTo({ |
|
|
|
|
|
|
|
url: '../mine/mine' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
that.globalData.token = token |
|
|
|
that.globalData.token = token |
|
|
|
that.request({ |
|
|
|
that.request({ |
|
|
|
url: `${that.globalData.API_URL}/sessions/new`, |
|
|
|
url: `${that.globalData.API_URL}/sessions/new`, |
|
|
@ -70,6 +76,9 @@ App({ |
|
|
|
content: '请前往 “我的” 页面绑定手机号', |
|
|
|
content: '请前往 “我的” 页面绑定手机号', |
|
|
|
showCancel: false, |
|
|
|
showCancel: false, |
|
|
|
success: function(res) { |
|
|
|
success: function(res) { |
|
|
|
|
|
|
|
// 清除没用的token
|
|
|
|
|
|
|
|
wx.removeStorage({key: 'userToken'}) |
|
|
|
|
|
|
|
that.globalData.token = undefined |
|
|
|
if (getCurrentPages().length > 1) { |
|
|
|
if (getCurrentPages().length > 1) { |
|
|
|
wx.navigateBack() |
|
|
|
wx.navigateBack() |
|
|
|
} |
|
|
|
} |
|
|
|