crator and messageResponse

This commit is contained in:
saeid
2019-04-24 21:20:12 +04:30
parent df660dd7d4
commit fc162db99b
29 changed files with 460 additions and 817 deletions
+6 -4
View File
@@ -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();
});
+11 -8
View File
@@ -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'
},
{