router.beforeEach((to, from, next) => {
// console.log('to:' + to.path)
if (to.path.startsWith('/login')) {
window.sessionStorage.removeItem('access-user')
next()
} else {
let user = JSON.parse(window.sessionStorage.getItem('access-user'))
if (!user) {
next({path: '/login'})
} else {
next()
}
}
})