xbx #75

Merged
theluyuan merged 7 commits from xbx into master 2020-08-28 16:14:36 +00:00
2 changed files with 7 additions and 5 deletions
Showing only changes of commit a6328358e2 - Show all commits

View File

@ -10,9 +10,9 @@ export default {
uni.getStorage({
key: "token",
success: (res) => {
uni.switchTab({
url: "/pages/index/index"
})
// uni.switchTab({
// url: "/pages/index/index"
// })
}
})
},

View File

@ -147,10 +147,12 @@ export default {
},
onLoad() {
let token = uni.getStorageSync('token');
let user = uni.getStorageSync('userinfo');
console.log( user.role == 2 ? '/pages/index/index' : '/pages/user/myinfo')
if (token != undefined && token) {
this.$u.route({
url: '/pages/index/index'
url: user.role == 2 ? '/pages/index/index' : '/pages/user/myinfo',
type: user.role == 2 ? 'tab' : 'to'
});
}
}