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