|
@@ -17,6 +17,8 @@ import Layout from '@/layout' |
|
@@ -17,6 +17,8 @@ import Layout from '@/layout' |
|
17
|
* redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
|
17
|
* redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
|
|
18
|
* name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
|
18
|
* name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
|
|
19
|
* query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
|
19
|
* query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
|
|
|
|
20
|
+ * roles: ['admin', 'common'] // 访问路由的角色权限
|
|
|
|
21
|
+ * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限
|
|
20
|
* meta : {
|
22
|
* meta : {
|
|
21
|
noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
|
23
|
noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
|
|
22
|
title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
|
24
|
title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
|
|
@@ -85,11 +87,16 @@ export const constantRoutes = [ |
|
@@ -85,11 +87,16 @@ export const constantRoutes = [ |
|
85
|
meta: { title: '个人中心', icon: 'user' }
|
87
|
meta: { title: '个人中心', icon: 'user' }
|
|
86
|
}
|
88
|
}
|
|
87
|
]
|
89
|
]
|
|
88
|
- },
|
90
|
+ }
|
|
|
|
91
|
+]
|
|
|
|
92
|
+
|
|
|
|
93
|
+// 动态路由,基于用户权限动态去加载
|
|
|
|
94
|
+export const dynamicRoutes = [
|
|
89
|
{
|
95
|
{
|
|
90
|
path: '/system/user-auth',
|
96
|
path: '/system/user-auth',
|
|
91
|
component: Layout,
|
97
|
component: Layout,
|
|
92
|
hidden: true,
|
98
|
hidden: true,
|
|
|
|
99
|
+ permissions: ['system:user:edit'],
|
|
93
|
children: [
|
100
|
children: [
|
|
94
|
{
|
101
|
{
|
|
95
|
path: 'role/:userId(\\d+)',
|
102
|
path: 'role/:userId(\\d+)',
|
|
@@ -103,6 +110,7 @@ export const constantRoutes = [ |
|
@@ -103,6 +110,7 @@ export const constantRoutes = [ |
|
103
|
path: '/system/role-auth',
|
110
|
path: '/system/role-auth',
|
|
104
|
component: Layout,
|
111
|
component: Layout,
|
|
105
|
hidden: true,
|
112
|
hidden: true,
|
|
|
|
113
|
+ permissions: ['system:role:edit'],
|
|
106
|
children: [
|
114
|
children: [
|
|
107
|
{
|
115
|
{
|
|
108
|
path: 'user/:roleId(\\d+)',
|
116
|
path: 'user/:roleId(\\d+)',
|
|
@@ -116,6 +124,7 @@ export const constantRoutes = [ |
|
@@ -116,6 +124,7 @@ export const constantRoutes = [ |
|
116
|
path: '/system/dict-data',
|
124
|
path: '/system/dict-data',
|
|
117
|
component: Layout,
|
125
|
component: Layout,
|
|
118
|
hidden: true,
|
126
|
hidden: true,
|
|
|
|
127
|
+ permissions: ['system:dict:list'],
|
|
119
|
children: [
|
128
|
children: [
|
|
120
|
{
|
129
|
{
|
|
121
|
path: 'index/:dictId(\\d+)',
|
130
|
path: 'index/:dictId(\\d+)',
|
|
@@ -129,6 +138,7 @@ export const constantRoutes = [ |
|
@@ -129,6 +138,7 @@ export const constantRoutes = [ |
|
129
|
path: '/monitor/job-log',
|
138
|
path: '/monitor/job-log',
|
|
130
|
component: Layout,
|
139
|
component: Layout,
|
|
131
|
hidden: true,
|
140
|
hidden: true,
|
|
|
|
141
|
+ permissions: ['monitor:job:list'],
|
|
132
|
children: [
|
142
|
children: [
|
|
133
|
{
|
143
|
{
|
|
134
|
path: 'index',
|
144
|
path: 'index',
|
|
@@ -142,6 +152,7 @@ export const constantRoutes = [ |
|
@@ -142,6 +152,7 @@ export const constantRoutes = [ |
|
142
|
path: '/tool/gen-edit',
|
152
|
path: '/tool/gen-edit',
|
|
143
|
component: Layout,
|
153
|
component: Layout,
|
|
144
|
hidden: true,
|
154
|
hidden: true,
|
|
|
|
155
|
+ permissions: ['tool:gen:edit'],
|
|
145
|
children: [
|
156
|
children: [
|
|
146
|
{
|
157
|
{
|
|
147
|
path: 'index',
|
158
|
path: 'index',
|