This commit is contained in:
parent
397b537b63
commit
3dd7aea121
@ -200,19 +200,12 @@ export const asyncRoutes = [
|
|||||||
{
|
{
|
||||||
path: '/getincentives',
|
path: '/getincentives',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/example/list',
|
|
||||||
name: 'Example Articles',
|
|
||||||
meta: {
|
|
||||||
title: 'Belohnungen',
|
|
||||||
icon: 'present',
|
|
||||||
roles: ['editor']
|
|
||||||
},
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'my',
|
path: 'my',
|
||||||
component: () => import('@/views/incentives/list'),
|
component: () => import('@/views/incentives/list'),
|
||||||
name: 'Belohnungen',
|
name: 'Belohnungen',
|
||||||
meta: { title: 'Belohnungen', icon: 'star', roles: ['editor'] }
|
meta: { roles: ['editor'], title: 'Belohnungen', icon: 'star' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -49,12 +49,7 @@ const mutations = {
|
|||||||
const actions = {
|
const actions = {
|
||||||
generateRoutes({ commit }, roles) {
|
generateRoutes({ commit }, roles) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
let accessedRoutes
|
const accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
|
||||||
if (roles.includes('admin')) {
|
|
||||||
accessedRoutes = asyncRoutes || []
|
|
||||||
} else {
|
|
||||||
accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
|
|
||||||
}
|
|
||||||
commit('SET_ROUTES', accessedRoutes)
|
commit('SET_ROUTES', accessedRoutes)
|
||||||
resolve(accessedRoutes)
|
resolve(accessedRoutes)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user