add role mock

This commit is contained in:
Pan
2019-03-18 12:32:23 +08:00
parent f3aefe54e8
commit 05ca5cae6d
3 changed files with 531 additions and 8 deletions

View File

@@ -1,22 +1,21 @@
import Mock from 'mockjs'
// import { deepClone } from '@/utils'
// import { filterAsyncRoutes } from '@/store/modules/permission'
// import { asyncRoutes, constantRoutes } from '@/router'
import { deepClone } from '../../src/utils/index.js'
import { asyncRoutes, constantRoutes } from './routes.js'
// const routes = deepClone([...constantRoutes, ...asyncRoutes])
const routes = deepClone([...constantRoutes, ...asyncRoutes])
const roles = [
{
key: 'admin',
name: 'admin',
description: 'Super Administrator. Have access to view all pages.',
routes: []
routes: routes
},
{
key: 'editor',
name: 'editor',
description: 'Normal Editor. Can see all pages except permission page',
routes: []
routes: routes.filter(i => i.path !== '/permission')// just a mock
},
{
key: 'visitor',
@@ -38,7 +37,7 @@ const roles = [
export default {
'/routes': () => {
return []
return routes
},
'/roles': () => {
return roles