修复了登录跳转

This commit is contained in:
2020-08-28 15:54:36 +08:00
parent 7c839816d4
commit a6328358e2
2 changed files with 7 additions and 5 deletions

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