Merge pull request 'gdpao' (#71) from gyh into master

Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/71
This commit is contained in:
gyh 2020-08-25 11:13:35 +08:00
commit 022192c9d6
2 changed files with 9 additions and 1 deletions

View File

@ -6,6 +6,15 @@ export default {
onLaunch: function() { onLaunch: function() {
getApp().globalData.im = this.imService getApp().globalData.im = this.imService
console.log('App Launch'); console.log('App Launch');
// token
uni.getStorage({
key: "token",
success: (res) => {
uni.switchTab({
url: "/pages/index/index"
})
}
})
}, },
onShow: function() { onShow: function() {
console.log('App Show'); console.log('App Show');

View File

@ -112,7 +112,6 @@ export default {
type: 'error' type: 'error'
}); });
} else { } else {
uni.setStorageSync('token', res.data.token); uni.setStorageSync('token', res.data.token);
uni.setStorageSync('userinfo', res.data); uni.setStorageSync('userinfo', res.data);
uni.setStorageSync('rongyun', res.data.rongcloud_token); uni.setStorageSync('rongyun', res.data.rongcloud_token);