Permission | vue | Vue router permission
Ithasbeenintroducedindetailinthisarticle--手摸手,带你用vue撸后台系列二(登录权限篇)[1].Theimplementationofthisprojectspermissionis:comparetheroutingtablebyobtainingthecurrentuserspermission,andgeneratetheroutingtableaccessiblebythecurrentuserwiththepermission,anddynamicallymountittorouterthroughrouter.addRoutes.Butinfact,thebusinesslogicofmanycompaniesmaynotbethecase.Forexample,therequirementofmanycompaniesisthatthepermissionsofeachpagearedynamicallyconfigured,unlikethedefaultsettingsinthisp...
It has been introduced in detail in this article--手摸手,带你用 vue 撸后台 系列二(登录权限篇)[1].
The implementation of this projects permission is: compare the routing table by obtaining the current users permission, and generate the routing table accessible by the current user with the permission, and dynamically mount it to router through router.addRoutes.
But in fact, the business logic of many companies may not be the case. For example, the requirement of many companies is that the permissions of each page are dynamically configured, unlike the default settings in this project. But in fact the principle is the same. For example, you can dynamically configure permissions for each page through a tree control or other presentation, and then store this routing table to the back end. When the user logs in to get roles, the front end requests the accessible routing table to the backend according to roles, so that the accessible pages are dynamically generated. After that, the router.ad...