54 lines
1.4 KiB
Plaintext
54 lines
1.4 KiB
Plaintext
管理后台权限控制:
|
||
|
||
用户登录的时候,后端接口返回给你权限数组
|
||
|
||
|
||
addRoutes
|
||
|
||
1:根据登录返回的权限数组 生成 左侧菜单
|
||
2:根据登录返回的权限数组 生成 路由配置
|
||
|
||
{
|
||
status: 200,
|
||
result: {
|
||
token: "WER2345465RTRGESEGRDHTGWFEWRGDTHY534T3",
|
||
jurisdiction: [
|
||
{
|
||
id: 1,
|
||
name: "用户管理",
|
||
icon: "icon-wedd",
|
||
path: "/user",
|
||
children: [
|
||
{
|
||
name: "用户列表",
|
||
icon: "icon-wedd",
|
||
path: "/list",
|
||
},
|
||
{
|
||
name: "用户统计",
|
||
icon: "icon-wedd",
|
||
path: "/tongji",
|
||
}
|
||
]
|
||
},
|
||
{
|
||
id: 1,
|
||
name: "产品管理",
|
||
icon: "icon-wedd",
|
||
path: "/product",
|
||
children: [
|
||
{
|
||
name: "产品列表",
|
||
icon: "icon-wedd",
|
||
path: "/list",
|
||
},
|
||
{
|
||
name: "产品统计",
|
||
icon: "icon-wedd",
|
||
path: "/tongji",
|
||
}
|
||
]
|
||
}
|
||
]
|
||
}
|
||
} |