router.beforeEach((to, from, next) => {
if (to.path != '/login') {
if (!window.sessionStorage.getItem("username")) {
next({
path: '/login'
})
} else {
next()
}
} else {
next()
}
})
router.beforeEach((to, from, next) => {
if (to.path != '/login') {
if (!window.sessionStorage.getItem("username")) {
next({
path: '/login'
})
} else {
next()
}
} else {
next()
}
})
本文标题:router.beforeEach((to, from, nex
本文链接:https://www.haomeiwen.com/subject/zfovdxtx.html
网友评论