The invention relates to the technical field of Web front-end development, and discloses a front-end intelligent menu caching and dynamic
authority control method. The method comprises the following steps: firstly, checking whether menu cache data in a local storage of a browser exists and is valid, if so, directly using the cache data, otherwise, obtaining latest menu data from a
server and caching according to a preset strategy; the menu data change state of the
server side is monitored in a timed
polling or
WebSocket mode, and the local cache is updated in time when the data change; acquiring role permission information of the
current user, matching the role permission information with the menu data, and dynamically generating an accessible menu tree; when routing jump is carried out, the type of a target address is intelligently judged, permission
verification is carried out on an internal routing address, and it is ensured that a user can only access pages within the
authorization range of the user. According to the application, the
server request frequency is reduced, the response speed of the front-end application is improved, and meanwhile, the real-time performance of the menu data and the access security are ensured.