mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 13:21:08 +03:30
change home
This commit is contained in:
Vendored
+6
-3
@@ -10,7 +10,7 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import Meta from 'vue-meta'
|
||||
|
||||
import { TokenService } from '@/services'
|
||||
// Routes
|
||||
import paths from './paths'
|
||||
|
||||
@@ -47,9 +47,12 @@ Vue.use(Meta)
|
||||
router.beforeEach((to, from, next) => {
|
||||
const isPublic = to.matched.some(record => record.meta.public);
|
||||
const onlyWhenLoggedOut = to.matched.some(record => record.meta.onlyWhenLoggedOut);
|
||||
const roles = (to.meta && to.meta.roles) ? to.meta.roles : null;
|
||||
const loggedIn = !!TokenService.getToken();
|
||||
|
||||
if (loggedIn && onlyWhenLoggedOut ) {
|
||||
window.location.href = '/dashboard';
|
||||
}
|
||||
|
||||
// Do not allow user to visit Pages then not access roles
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user