From 1c5769016dff83372bd21279888a6ce4eeb640df Mon Sep 17 00:00:00 2001 From: alfredojl Date: Tue, 25 Aug 2020 21:08:19 -0500 Subject: [PATCH] =?UTF-8?q?Cambios=20acerca=20de=20visualizaciones=20admin?= =?UTF-8?q?istrativas=20a=C3=B1adidas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes.js | 12 +++++++++--- src/views/Login.vue | 14 +++++++------- src/views/User.vue | 31 +++++++++++++++++++------------ 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/routes.js b/src/routes.js index e4ff3e8..1929d06 100644 --- a/src/routes.js +++ b/src/routes.js @@ -12,14 +12,20 @@ const routes = [{ }, { path: '/', - component: Login, - name: 'start' + name: 'root', + redirect: 'login' }, { path: '/login', component: Login, name: 'login', meta: { isPublic: true }, + beforeEnter: (to, from, next) => { + if (isAuthenticated()) + next('/user'); + else + next(); + } }, { path: '/user', @@ -30,7 +36,7 @@ const routes = [{ if (isAuthenticated()) next(true); else - next('/login'); + next(false); } }, { diff --git a/src/views/Login.vue b/src/views/Login.vue index e1f4be6..7b5232d 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -12,6 +12,7 @@ - Usuario o contraseƱa invalidos + Usuario o contraseƱa incorrectos.