修复了登录跳转
This commit is contained in:
parent
7c839816d4
commit
a6328358e2
6
App.vue
6
App.vue
@ -10,9 +10,9 @@ export default {
|
||||
uni.getStorage({
|
||||
key: "token",
|
||||
success: (res) => {
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index"
|
||||
})
|
||||
// uni.switchTab({
|
||||
// url: "/pages/index/index"
|
||||
// })
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -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'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user