update 1400-10-09

This commit is contained in:
sedmedgh
2021-12-30 16:13:42 +03:30
parent e510b6ab98
commit 6b6b9a3652
79 changed files with 3323 additions and 395 deletions
+42 -5
View File
@@ -49,7 +49,10 @@ const router = new Router({
{
path: '/',
name: 'dashboard',
redirect: '/dashboard'
redirect: '/dashboard',
meta: {
rule: 'editor'
}
},
{
path: '/dashboard',
@@ -86,6 +89,24 @@ const router = new Router({
parent: 'main'
}
},
{
path: '/users',
name: 'users',
component: () => import('./views/users/users.vue'),
meta: {
rule: 'editor',
parent: 'main'
}
},
{
path: '/register/users',
name: 'register-users',
component: () => import('./views/users/create.vue'),
meta: {
rule: 'editor',
parent: 'main'
}
},
{
path: '/register/personnel',
name: 'register-personnel',
@@ -106,6 +127,23 @@ const router = new Router({
},
]
},
{
path: '/pages/error-404',
name: 'error-404',
component: () => import('./views/pages/Error404'),
meta: {
rule: 'editor'
}
},
{
path: '/pages/error-403',
name: 'error-403',
component: () => import('./views/pages/NotAuthorized'),
meta: {
rule: 'editor'
}
},
{
path: '*',
redirect: '/pages/error-404'
@@ -125,21 +163,20 @@ router.beforeEach((to, from, next) => {
let isLogin = sessionStorage.getItem('accessToken');
//console.log("to.path ==> ", to.path);
if (
(
to.path === "/register/form" ||
to.path === "/auth/login" ||
to.path === "/auth/register" ||
to.path === "/pages/error-404" ||
to.path === "/pages/error-403" ||
to.path === "/auth/forgot-password"
)
) {
) {
/* if (isLogin) {
router.push({path: '/'});
}*/
return next();
}
if (!isLogin) {
else if (!isLogin) {
router.push({path: '/auth/login'});
return;
} else {