mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 07:01:05 +03:30
crator and messageResponse
This commit is contained in:
Vendored
+6
-4
@@ -52,12 +52,14 @@ const router = new Router({
|
||||
|
||||
Vue.use(Meta)
|
||||
|
||||
import {$hasRole} from '@/services/acl/role';
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const isPublic = to.matched.some(record => record.meta.public);
|
||||
const onlyWhenLoggedOut = to.matched.some(record => record.meta.onlyWhenLoggedOut);
|
||||
const loggedIn = !!TokenService.getToken();
|
||||
const roles = to.matched.some(record => record.meta.roles);
|
||||
const roles = (to.meta && to.meta.roles) ? to.meta.roles : null;
|
||||
|
||||
if (!isPublic && !loggedIn) {
|
||||
return next({
|
||||
path:'/login',
|
||||
@@ -71,9 +73,9 @@ router.beforeEach((to, from, next) => {
|
||||
}
|
||||
|
||||
// Do not allow user to visit Pages then not access roles
|
||||
// if (roles && !$hasRole(roles)) {
|
||||
// return next('/')
|
||||
// }
|
||||
if (roles && !$hasRole(roles)) {
|
||||
return next('/')
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
Vendored
+11
-8
@@ -11,27 +11,30 @@ export default [
|
||||
},
|
||||
{
|
||||
path: '/my-info',
|
||||
name: 'My Info',
|
||||
name: 'MyInfo',
|
||||
view: 'MyInfo'
|
||||
},
|
||||
{
|
||||
path: '/all-resualttest',
|
||||
name: 'All Result Test',
|
||||
name: 'AllResultTest',
|
||||
view: 'AllResultTest'
|
||||
},
|
||||
{
|
||||
path: '/manage-users',
|
||||
name: 'Manage Users',
|
||||
name: 'ManageUsers',
|
||||
view: 'ManageUsers',
|
||||
meta: {
|
||||
roles : 'Admin'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/test-creator',
|
||||
name: 'Add New Test',
|
||||
name: 'AddNewTest',
|
||||
view: 'TestCreator'
|
||||
},
|
||||
{
|
||||
path: '/manage-medical-center',
|
||||
name: 'Manage Medical Center',
|
||||
name: 'ManageMedicalCenter',
|
||||
view: 'ManageMedicalCenter'
|
||||
},
|
||||
{
|
||||
@@ -64,7 +67,7 @@ export default [
|
||||
},
|
||||
{
|
||||
path: '/submit-test-result',
|
||||
name: 'Submit Test Result',
|
||||
name: 'SubmitTestResult',
|
||||
view: 'SubmitTestResult'
|
||||
},
|
||||
{
|
||||
@@ -78,7 +81,7 @@ export default [
|
||||
},
|
||||
{
|
||||
path: '/test-creator',
|
||||
name: 'Test Creator',
|
||||
name: 'TestCreator',
|
||||
view: 'TestCreator'
|
||||
},
|
||||
{
|
||||
@@ -88,7 +91,7 @@ export default [
|
||||
},
|
||||
{
|
||||
path: '/add-medical-center',
|
||||
name: 'Add Medical Center',
|
||||
name: 'AddMedicalCenter',
|
||||
view: 'AddMedicalCenter'
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user