修复了登录跳转

This commit is contained in:
luyuan 2020-08-28 15:54:36 +08:00
parent 7c839816d4
commit a6328358e2
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
2 changed files with 7 additions and 5 deletions

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'
});
}
}