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

暂时修改下逻辑

parent 867ac68b
...@@ -212,20 +212,19 @@ const router = new Router({ ...@@ -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') var token = window.sessionStorage.getItem('token')
if (token !== null) { if (token !== null) {
if (to.path === '/login') { if (to.path === '/login') {
next('/main') next('/main')
} else if (to.path === '/main') {
next()
} else { } else {
var menuList = window.sessionStorage.getItem('menuList') // var menuList = window.sessionStorage.getItem('menuList')
if (menuList.indexOf(to.path) > -1) { // if (menuList.indexOf(to.path) > -1) {
next() // next()
} else { // } else {
next('/main') // next('/main')
} // }
next()
} }
} else { } else {
if (to.path === '/login') { 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