Files
ClassContent/历届学生/fontendsix/项目练习/上课项目/管理后台/笔记.txt
2024-09-27 02:06:13 +08:00

37 lines
859 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

权限控制 页面权限,按钮权限
动态路由
思路:
1:后台在登录的时候,后端一般会给token,权限数组
管理后台的导航菜单,一般两级菜单
[
{
"title": "用户管理"
"icon": "user",
"zujian": "",
"path": "/user",
"children": [
{
"title": "删除用户"
"icon": "delete",
"zujian": "",
"path": "/delete",
"children":
},
{
"title": "增加用户"
"icon": "add",
"zujian": "",
"path": "/add",
"children":
}
]
}
]
2: 使用权限数组生成左侧的导航菜单
3:使用权限数组生成路由的配置文件,然后动态的追加到vue-router中,addRouters 让动态路由生效