修复了登录跳转
This commit is contained in:
parent
7c839816d4
commit
a6328358e2
6
App.vue
6
App.vue
@ -10,9 +10,9 @@ export default {
|
|||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: "token",
|
key: "token",
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
uni.switchTab({
|
// uni.switchTab({
|
||||||
url: "/pages/index/index"
|
// url: "/pages/index/index"
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -147,10 +147,12 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
let token = uni.getStorageSync('token');
|
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) {
|
if (token != undefined && token) {
|
||||||
this.$u.route({
|
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