Commit 0e6583f5 authored by 黎博's avatar 黎博

暂时修改下逻辑

parent 867ac68b
......@@ -212,20 +212,19 @@ const router = new Router({
]
})
// 判断用户是否登陆到系统
router.beforeEach(function(to, from, next) {
router.beforeEach(function (to, from, next) {
var token = window.sessionStorage.getItem('token')
if (token !== null) {
if (to.path === '/login') {
next('/main')
} else if (to.path === '/main') {
next()
} else {
var menuList = window.sessionStorage.getItem('menuList')
if (menuList.indexOf(to.path) > -1) {
next()
} else {
next('/main')
}
// var menuList = window.sessionStorage.getItem('menuList')
// if (menuList.indexOf(to.path) > -1) {
// next()
// } else {
// next('/main')
// }
next()
}
} else {
if (to.path === '/login') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment