当前位置:网站首页>后台管理系统 权限设置大致流程
后台管理系统 权限设置大致流程
2022-07-27 15:08:00 【Mr_ZCheng】
用户管理:帐号的增删改查,为该帐号分配角色
角色管理:角色的增删改查,为该角色分配权限数据
权限管理:需要进行权限管理的页面进行增删改查
权限管理分三部分
api
主要后端处理,
前端:响应拦截统一错误处理
路由
将路由分为二大块
静态路由:不需要访问权限的路由
动态路由:需要权限访问的路由
默认只有静态路由
在获取到用户信息后
用户信息中包含当前用户能访问的权限页面的数据
通过和动态路由匹配出能访问的页面的路由信息
通过addRoutes动态添加到路由上
出现了一些坑点
刚添加的路由不能立马使用需要再经过一次导航守卫:
解决方式:next(to.fullPath)
404问题(刚添加的不能立马使用,如果静态路由中包含*匹配404,就会直接跳转到404)
解决方式:将静态路由中的04匹配删除,通过addRoutes添加到最后
菜单问题
早期 菜单使用this.$router.options.routes,
该值不是响应式的,造成菜单没有对应更新
解决方式
通过vuex存储路由配制数据(和路由配制保持同步)
使用vuex中的路由配制路由实现响应式
退出切换帐号上一个帐号addRoutes添加的路由还能使用
解决方式:退出时重置路由
按钮
通过自定义指令当用户信息的按钮权限信息包含当前按钮标识 时正常显示,不包含就不显示
v-if/v-show mixin也可以
边栏推荐
- Gartner 权威预测未来4年网络安全的8大发展趋势
- 移动端页面布局
- Database foundation
- SAP UI5 FileUploader 使用的隐藏 iframe 和 form 元素的设计明细
- This large model sparse training method with high accuracy and low resource consumption has been found by Alibaba cloud scientists! Has been included in IJCAI
- JSP El expression, JSTL tag
- Flex弹性盒布局2
- 三表联查3
- 国产新冠口服药为什么是治艾滋病的药
- Servlet Chinese garbled setcontenttype setting is invalid
猜你喜欢

MySQL - linked table query

Two table joint query 1

C语言之程序环境和预处理

国产新冠口服药为什么是治艾滋病的药

C语言之结构体及位段

Data collection: skillfully using Bloom filter to extract data summary

Day07 operation

Advanced pointer of C language

This large model sparse training method with high accuracy and low resource consumption has been found by Alibaba cloud scientists! Has been included in IJCAI

UML图介绍
随机推荐
Ten thousand words analysis ribbon core components and operation principle
Flex flex flex box layout 2
WebView basic use
渐变环形进度条
京东张政:内容理解在广告场景下的实践和探索
Mobile page layout
Gartner 权威预测未来4年网络安全的8大发展趋势
Pointer elementary of C language
两表联查1
Jerry's built-in touch parameters for modification [chapter]
Program environment and preprocessing of C language
Gartner authority predicts eight development trends of network security in the next four years
Two table joint query 1
Niuke topic -- binary search tree and bidirectional linked list
全局String对象(函数类型)+Math对象
UITableView 基本使用和优化
C语言之数组
三表联查3
Servlet用Cookie实现用户上次登录时间
Build a cloud native file system for media assets