How do different people in the background management system show different data?

1. First of all, the background management system is built by Vue, and the chart data displayed is realized by eharts.
2. According to the demand, when submitting the account password on the login page, determine whether the user is the leadership or the employee level, if it is the leadership, display the relevant page data of the leadership, if it is the employee level, display the relevant page data of the employee level.
so what should I do? When the judgment is a leader, how to hide the employee data and display the leadership data, when the judgment is an employee, how to hide the leadership data and display the employee data.

as shown in the figure, router-view is the area where the data is displayed.

Mar.12,2021

this is when logging in, the background determines what permissions the user you logged in has, and then returns the corresponding data to you. Your corresponding functional modules are generated from the background data


if the table is different, then simply use v-if
if the same data is different, let the back end return the corresponding data to you to send token or user name or so on.


data you obtained from the background, then let the backend return your corresponding data according to the login personnel's judgment. Permissions are generally controlled by the background


.

first make sure that your problem is hidden, not inaccessible.
in other words, this is not system-level interface access, but product-level user access to the user experience.

it is assumed to be a more general background.

  1. routing permissions that control whether you can access a page. First of all, you need to distinguish at the front end what is a route that requires permissions (view the operation) and what is a route that does not require permissions (login registration). The backend needs to return the route (menu) that your current user can access according to the role, and then you need to dynamically load the matching route after login.
  2. module permissions that control what you can see and do when you visit a page. You need to make a contract with the backend, for example, after returning what convention, you can let the user see or manipulate which component (CRUD component).
Menu