/login is alias of signin component.
This commit is contained in:
@@ -54,6 +54,7 @@ let routes = [
|
|||||||
{
|
{
|
||||||
name: 'signin',
|
name: 'signin',
|
||||||
path: '/signin',
|
path: '/signin',
|
||||||
|
alias: '/login',
|
||||||
component: (resolve) => require(['./components/Signin.vue'], resolve)
|
component: (resolve) => require(['./components/Signin.vue'], resolve)
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
@@ -107,7 +108,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
|
|
||||||
if (to.matched.some(record => record.meta.requiresAuth)) {
|
if (to.matched.some(record => record.meta.requiresAuth)) {
|
||||||
if (localStorage.getItem('token') == null) {
|
if (localStorage.getItem('token') == null) {
|
||||||
next({ path: '/login' });
|
next({ path: '/signin' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user