diff --git a/src/router/index.js b/src/router/index.js index 4688ce1..b8577b9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -46,7 +46,12 @@ const routes = [ { path: '/', name: 'Index', - component: Index + component: Index, + beforeEnter: (_to, _from, next) => { + if (store.state.token) { + next({name: 'Search'}) + } + } }, ]