Dynamic route generation method and device, equipment and medium

By obtaining user login information and generating dynamic routing instances and interactive menus, the problems of high maintenance costs and low system security caused by static routing configuration in the prior art are solved, and dynamic permission adjustment and efficient system management are realized.

CN119494094APending Publication Date: 2025-02-21CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311038314.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-17
Publication Date
2025-02-21

Smart Images

  • Figure CN119494094A_ABST
    Figure CN119494094A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of electronic technologies, and particularly relates to a dynamic route generation method and device, equipment and a medium. The method comprises the steps of obtaining login information input by a user; the login information is sent to a server; acquiring an authority file determined by the server according to the login information; and generating an interaction menu and a dynamic routing instance matched with the interaction menu according to the permission file. The problem that maintenance is not easy due to the fact that permission setting is complex in the prior art is solved, and the management efficiency and the secondary development efficiency of developers are greatly improved. And meanwhile, the problem of slow page loading caused by overlarge storage capacity of a single routing configuration file is also avoided. And the front end is only provided with the routing list corresponding to the authority, so that the user cannot enter a non-authority page in a manner of directly inputting the website, and the safety of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of electronic technology, and specifically relates to a method, device, equipment and medium for generating a dynamic route. Background Art

[0002] The traditional menu control method of the system is: the front end writes the routing table locally, as well as the role corresponding to each route, that is, which roles can see this menu / route.

[0003] In the prior art, when logging in, a request is made to the backend to obtain the role of the logged-in user (administrator, ordinary user); by using route interception, the obtained user role is compared with the local route table, the route corresponding to the user is filtered out, and the route is used to render the left menu.

[0004] However, since the routes are hard-coded in the front-end code, developers need to manually modify the routes in the code file every time they modify the routes. And when there are too many routes, there may be multiple route files, which makes it more troublesome and inconvenient to find them.

[0005] For medium and large systems, in order to support a wide range of functions, there are many pages. With the increase in the number of users, it is inevitable that different types of permissions will be formulated for different types of users. With the increase in permissions, the original static routes cannot be changed according to the modification of user permissions. The code can only be modified again, which greatly increases the cost of maintaining the code. And because there is a static route list on the front end, sometimes users can directly enter the target URL on the front end to enter the page without permission, bypassing the route filtering process, which greatly affects the security of the system. Summary of the invention

[0006] In response to the above technical problems, the present invention proposes a method, device, equipment and medium for generating dynamic routes. The present application obtains the login information input by the user; sends the login information to the server; obtains the permission file determined by the server according to the login information; generates an interactive menu and a dynamic routing instance matching the interactive menu according to the permission file. It solves the problem of difficult maintenance due to complex permission settings in the prior art, and greatly improves the efficiency of developer management and secondary development. At the same time, it also avoids the problem of slow page loading caused by excessive storage of a single routing configuration file. Moreover, since there is only a routing list with corresponding permissions on the front end, users cannot enter the unauthorized page by directly entering the URL, which improves the security of the system.

[0007] To solve the above technical problems, the technical solution adopted by the present invention includes four aspects.

[0008] In a first aspect, a method for generating a dynamic route is provided, comprising: obtaining login information input by a user; sending the login information to a server; obtaining a permission file determined by the server according to the login information; and generating an interactive menu and a dynamic route instance matching the interactive menu according to the permission file.

[0009] In some embodiments, generating the interactive menu according to the permission file includes: generating a template menu; traversing the permission file to obtain the permission data contained in the permission file; filling the permission data into the template menu to generate the interactive menu.

[0010] In some embodiments, generating a dynamic routing instance matching the interactive menu based on the permission file includes: looping through the permission data to obtain permission objects corresponding to each permission in the permission data; generating a permission list from the permission objects; generating a template routing instance matching the template menu; and modifying the template routing instance based on the permission list to generate a dynamic routing instance matching the interactive menu.

[0011] In some embodiments, the method further includes: storing the authority file in a browser cache to prevent the authority file from being lost due to refreshing the page.

[0012] In some embodiments, the method also includes: detecting whether there is a page jump instruction; when the page jump instruction exists, determining the target routing authority required to jump to the target page; searching in the dynamic routing instance according to the target routing authority to determine whether the target routing authority exists in the dynamic routing instance; when the target routing authority does not exist in the dynamic routing list, jumping the page to the login page.

[0013] In some embodiments, the method also includes: detecting whether a page refresh operation has occurred; when a page refresh operation is detected, detecting whether the permission file is stored in the browser cache; when the permission file is stored in the browser cache, generating an interactive menu and a dynamic routing instance matching the interactive menu based on the permission file.

[0014] In some embodiments, the method further includes: detecting whether there is a logout instruction; when the logout instruction is detected, clearing the permission file stored in the browser cache.

[0015] In the second aspect, the present application provides a dynamic routing generation device, including: a first acquisition module, used to obtain login information input by a user; a first execution module, used to send the login information to a server; a second acquisition module, used to obtain a permission file determined by the server based on the login information; a first generation module, used to generate an interactive menu and a dynamic routing instance matching the interactive menu based on the permission file.

[0016] In a third aspect, the present application proposes an electronic device, comprising: a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method described in any one of the first aspects is performed.

[0017] In a fourth aspect, the present application proposes a storage medium, which stores a computer program that can be executed by one or more processors, and the computer program can be used to implement the method described in any one of the first aspects.

[0018] Beneficial effects created by the present invention: The present application obtains login information input by a user; sends the login information to a server; obtains a permission file determined by the server according to the login information; generates an interactive menu and a dynamic routing instance matching the interactive menu according to the permission file. The problem of difficult maintenance due to complex permission settings in the prior art is solved, and the efficiency of developer management and secondary development is greatly improved. At the same time, the problem of slow page loading caused by excessive storage of a single routing configuration file is also avoided. Moreover, since there is only a routing list with corresponding permissions on the front end, users cannot enter unauthorized pages by directly entering the URL, which improves the security of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The scope of the present disclosure may be better understood by reading the following detailed description of exemplary embodiments in conjunction with the accompanying drawings. The drawings included are:

[0020] Figure 1 An overall flow chart of a method for generating a dynamic route provided in an embodiment of the present application;

[0021] Figure 2 A structural block diagram of a dynamic routing generation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0023] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0024] If similar descriptions of "first\second\third" appear in the application documents, the following instructions will be added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0026] Embodiment 1:

[0027] In the prior art, since the routes are hard-coded in the front-end code, developers need to manually modify the routes in the code file each time the routes are modified. And when there are too many routes, there may be multiple route files, which makes it more troublesome and inconvenient to find them.

[0028] For medium and large systems, in order to support a wide range of functions, there are many pages. With the increase in the number of users, it is inevitable that different types of permissions will be formulated for different types of users. With the increase in permissions, the original static routes cannot be changed according to the modification of user permissions. The code can only be modified again, which greatly increases the cost of maintaining the code. And because there is a static route list on the front end, sometimes users can directly enter the target URL on the front end to enter the page without permission, bypassing the route filtering process, which greatly affects the security of the system.

[0029] In view of the problems existing in the prior art, such as Figure 1 As shown, the present application provides a method for generating a dynamic route, and the method is applied to an electronic device, and the electronic device may be a mobile terminal, a computer, a cloud platform, etc. The function implemented by the device data processing provided in the embodiment of the present application can be implemented by calling a program code by a processor of the electronic device, wherein the program code can be stored in a computer storage medium, and the method for generating a dynamic route includes:

[0030] Step S1: Obtain login information input by the user.

[0031] Since this application involves the issue of system login permissions, the server stores permission data corresponding to the login information. Therefore, if you want to implement dynamic permissions, you need to first obtain the permissions corresponding to the user, and the permissions are bound to the login account. Therefore, in this application, the user needs to enter the login information, which includes: login account, login password, account information and other basic information. When the user enters the login information, permissions are still required, so there is also a static routing table in the front end of this application, which only supports users to log in to the system through their account and password.

[0032] Step S2: Send the login information to the server.

[0033] In order to solve the technical problems existing in the prior art, all the permission data in this application are stored in the server, and the server also stores the permission data corresponding to each login information. Therefore, if you want to generate dynamic routes on the front end, you need to send the login information to the server.

[0034] Step S3: Obtain the authority file determined by the server according to the login information.

[0035] After receiving the login information, the server determines the authority file that matches the login information according to the content recorded in the login information, and sends the authority file to the front end. The authority file includes: authority data and a method for modifying the routing reason list of the front end.

[0036] Step S4: Generate an interactive menu and a dynamic routing instance matching the interactive menu according to the authority file.

[0037] In addition to the function menu, the client also needs a matching routing instance to run. The routing instance stores the permissions required for page jumps. If there is no relevant permission when the page jumps, it will be blocked, so we need to generate the corresponding interactive menu and dynamic routing instance based on the permission file.

[0038] Therefore, in some embodiments, the step S4 of "generating an interactive menu according to the authority file" includes:

[0039] Step S41: Generate a template menu.

[0040] Step S42: traverse the authority file to obtain the authority data contained in the authority file.

[0041] Step S43: Fill the permission data into the template menu to generate the interactive menu.

[0042] Before generating an interactive menu, you need to generate a template menu first. Since the permission file includes a lot of permission data, you need to traverse the permission file, extract the permission data one by one, and then fill the permission data into the template menu, and then render the template menu filled with permission data to get the interactive menu. The permission data mainly includes: permission objects and corresponding menu names. Therefore, when filling permission data into the template menu, you can fill the permission objects and menu names into the template menu one by one.

[0043] In some embodiments, in step S4, "generating a dynamic routing instance matching the interactive menu according to the authority file" includes:

[0044] Step S44: loop through the permission data to obtain permission objects corresponding to each permission in the permission data.

[0045] Step S45: Generate a permission list from the permission object.

[0046] Step S46: Generate a template routing instance that matches the template menu.

[0047] Step S47: modifying the template routing instance according to the permission list to generate a dynamic routing instance matching the interactive menu.

[0048] There are various function pages in the system, and corresponding permissions are required to enter each function page. When entering each function page, the user's permissions will be verified. Therefore, in this application, it is necessary to traverse the permission data and extract the permission objects in the permission data. Then the permission object generates a permission list that can be verified. The routing instance is a file used to store the permission list. This file can be created at the same time as the template menu is created to generate a template routing instance corresponding to the template menu. After obtaining the permission list, the data in the template reason instance can be modified according to the permission list, thereby generating a dynamic routing instance that matches the interactive menu.

[0049] This application fundamentally solves the problem of difficult permission management and low system security in the current static routing table. Because this application only obtains the permission file that matches the login information from the server, and the permission file does not contain permissions other than those owned by the login information, it also avoids the situation where users use other permissions pre-existing in the front end through other technical means, greatly improving the security of the system. Since the permission list of this application, which can also be called the routing list, is dynamically formed, when changing permissions, it is only necessary to modify the permissions of the corresponding user in the permission management interface, and there is no need to modify the routes in the file code, which greatly reduces the workload of maintenance personnel, and is easier to modify, greatly avoiding the situation where permissions are modified incorrectly, and improving the stability of the system.

[0050] In some embodiments, considering that the user may be affected by other situations and refresh the page during use, a method for generating a dynamic route also includes:

[0051] Step S5: Storing the authority file in the browser cache to prevent the authority file from being lost due to refreshing the page.

[0052] Generally speaking, when a page is refreshed, the content loaded in the page will disappear, so the content loaded in the page needs to be regenerated. Regenerating the content loaded in the page requires a permission file, so in this application, the permission file is stored in the browser cache to prevent the loss of the permission file when refreshing the page.

[0053] In some embodiments, a method for generating a dynamic route further includes:

[0054] Step S61: Detect whether a page refresh operation has occurred.

[0055] Step S62: When a page refresh operation is detected, it is detected whether the authority file is stored in the browser cache.

[0056] Step S63: when the authority file is stored in the browser cache, an interactive menu and a dynamic routing instance matching the interactive menu are generated according to the authority file.

[0057] Before regenerating the interactive menu and the dynamic routing instance, it is necessary to first determine whether a page refresh operation has occurred. After determining that a page refresh operation has occurred, it is necessary to determine whether the permission file is still stored in the browser cache. When it is determined that the permission file is stored in the browser cache, the interactive menu and the dynamic routing instance matching the interactive menu are generated again according to the permission file.

[0058] Generally, the data stored in the browser cache is cleared only when the browser is closed. However, in order to further ensure the security of the system and prevent someone from circumventing the permissions by caching other users' permission files in the browser, in some embodiments, a method for generating a dynamic route of the present application further includes:

[0059] Step S71: Detect whether there is a logout instruction.

[0060] Step S72: When the logout instruction is detected, the permission file stored in the browser cache is cleared.

[0061] In order to further improve the security of the system, the application will also detect the logout instruction. When the logout instruction is detected, the permission files stored in the browser cache will be cleared to prevent other people from bypassing the permission by using the permission files stored in the browser cache, which can better improve the security of the system.

[0062] In some embodiments, in order to further ensure the security of the system and prevent users from circumventing permissions through other means, a method for generating a dynamic route in the present application also includes:

[0063] Step S81: Detect whether there is a page jump instruction.

[0064] Step S82: When the page jump instruction exists, determine the target routing authority required to jump to the target page.

[0065] Step S83: searching the dynamic routing instance according to the target routing authority to determine whether the target routing authority exists in the dynamic routing instance.

[0066] Step S84: When the target routing authority does not exist in the dynamic routing list, the page is jumped to the login page.

[0067] Each time a page jump occurs, the permissions required to jump to the page will be confirmed to confirm whether the corresponding permissions exist in the generated dynamic routing instance. If so, jump to the target page; if not, jump to the login page.

[0068] The present application fundamentally solves the problem of difficulty in authority management and low system security of the current static routing table by generating dynamic routing instances and interactive menus from the authority files matching the login information obtained from the server. Because the present application only obtains the authority files matching the login information from the server, and the authority files do not contain the authority other than the authority owned by the login information, it also avoids the situation that the user uses other authority pre-existing in the front end through other technical means, which greatly improves the security of the system. Since the authority list of the present application, which can also be called the routing list, is dynamically formed, when changing the authority, it is only necessary to modify the authority of the corresponding user in the authority management interface, and there is no need to modify the route in the file code, which greatly reduces the workload of the maintenance personnel, and it is easier to modify, greatly avoids the situation of error in authority modification, and improves the stability of the system. Moreover, the present application only receives the authority information related to the login information, which can avoid the slow speed caused by the receiving file being too large, and also reduces the requirements for the front-end device and reduces the energy consumption of the front-end device.

[0069] Embodiment 2:

[0070] Based on the foregoing embodiments, the embodiments of the present application provide a device for generating a dynamic route. The modules included in the device and the units included in the modules can be implemented by a processor in a computer device; of course, they can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Microprocessor Unit), a digital signal processor (DSP, Digital Signal Processing) or a field programmable gate array (FPGA, Field Programmable Gate Array), etc.

[0071] like Figure 2 As shown, a dynamic route generation device includes: a first acquisition module 1, a first execution module 2, a second acquisition module 3 and a first generation module 4.

[0072] The first acquisition module 1 is used to acquire the login information input by the user. The first execution module 2 is used to send the login information to the server. The second acquisition module 3 is used to acquire the authority file determined by the server according to the login information. The first generation module 4 is used to generate an interactive menu and a dynamic routing instance matching the interactive menu according to the authority file.

[0073] In some embodiments, the first generating module 4 includes: a second generating module, a second executing module and a third generating module.

[0074] The second generation module is used to generate a template menu. The second execution module is used to traverse the permission file to obtain the permission data contained in the permission file. The third execution module is used to fill the permission data into the template menu to generate the interactive menu.

[0075] In some embodiments, the first generating module 4 includes: a fourth executing module, a fourth generating module, a fifth generating module and a sixth generating module.

[0076] The fourth execution module is used to loop through the permission data to obtain permission objects corresponding to each permission in the permission data. The fourth generation module is used to generate a permission list from the permission object. The fifth generation module is used to generate a template routing instance that matches the template menu. The sixth generation module is used to modify the template routing instance according to the permission list to generate a dynamic routing instance that matches the interactive menu.

[0077] In some embodiments, the dynamic route generation device further includes: a fifth execution module.

[0078] The fifth execution module is used to store the authority file in the browser cache to prevent the authority file from being lost due to refreshing the page.

[0079] In some embodiments, the dynamic route generation device further includes: a first detection module, a first determination module, a sixth execution module and a seventh execution module.

[0080] The first detection module is used to detect whether there is a page jump instruction. The first determination module is used to determine the target routing authority required to jump to the target page when the page jump instruction exists. The sixth execution module is used to search the dynamic routing instance according to the target routing authority to determine whether the target routing authority exists in the dynamic routing instance. The seventh execution module is used to jump the page to the login page when the target routing authority does not exist in the dynamic routing list.

[0081] In some embodiments, the dynamic route generation device further includes: a second detection module, a third detection module and an eighth execution module.

[0082] The second detection module is used to detect whether a page refresh operation has occurred. The third detection module is used to detect whether the permission file is stored in the browser cache when a page refresh operation is detected. The eighth execution module is used to generate an interactive menu and a dynamic routing instance matching the interactive menu according to the permission file when the permission file is stored in the browser cache.

[0083] In some embodiments, the dynamic route generation device further includes: a fourth detection module and a ninth execution module.

[0084] The fourth detection module is used to detect whether there is a logout instruction. The ninth execution module is used to clear the authority file stored in the browser cache when the logout instruction is detected.

[0085] Each module in the above-mentioned dynamic route generation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the device in the form of hardware, or can be stored in the memory in the processing device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0086] Embodiment 3:

[0087] A third aspect provides an electronic device, including a storage device and a processor, wherein the storage device stores a computer program, and the processor implements the steps of a dynamic route generation method when executing the computer program.

[0088] Embodiment 4:

[0089] A fourth aspect provides a storage medium, wherein a computer program stored in the storage medium can be executed by one or more processors, and the computer program can be used to implement the steps of any one of the dynamic route generation methods in the first aspect.

[0090] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0091] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0092] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0093] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0094] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0095] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0096] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read Only Memory), disks or optical disks, etc. Various media that can store program codes.

[0097] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a controller to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0098] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for generating a dynamic route, characterized in that: include; Get the login information entered by the user; Sending the login information to a server; Obtaining the authority file determined by the server according to the login information; An interactive menu and a dynamic routing instance matching the interactive menu are generated according to the authority file.

2. The method according to claim 1, characterized in that The generating an interactive menu according to the authority file includes: Generate template menu; Traversing the authority file to obtain the authority data contained in the authority file; The permission data is filled into the template menu to generate the interactive menu.

3. The method according to claim 2, characterized in that The step of generating a dynamic routing instance matching the interactive menu according to the authority file includes: The permission data is traversed in a loop to obtain a permission object corresponding to each permission in the permission data; Generate a permission list from the permission object; Generate a template routing instance matching the template menu; The template routing instance is modified according to the permission list to generate a dynamic routing instance matching the interactive menu.

4. The method according to claim 1, characterized in that The method further comprises: The authority file is stored in the browser cache to prevent the authority file from being lost due to refreshing the page.

5. The method according to claim 1, characterized in that The method further comprises: Detect whether there is a page jump instruction; When the page jump instruction exists, determining the target routing authority required to jump to the target page; Searching the dynamic routing instance according to the target routing authority to determine whether the target routing authority exists in the dynamic routing instance; When the target routing authority does not exist in the dynamic routing list, the page is redirected to the login page.

6. The method according to claim 4, characterized in that The method further comprises: Detect whether a page refresh operation has occurred; When a page refresh operation is detected, detecting whether the authority file is stored in the browser cache; When the authority file is stored in the browser cache, an interactive menu and a dynamic routing instance matching the interactive menu are generated according to the authority file.

7. The method according to claim 4, characterized in that The method further comprises: Check whether there is a logout instruction; When the logout instruction is detected, the authority file stored in the browser cache is cleared.

8. A dynamic routing generation device, characterized in that: include: A first acquisition module, used to acquire login information input by a user; A first execution module, used for sending the login information to a server; A second acquisition module, used to acquire the authority file determined by the server according to the login information; The first generating module is used to generate an interactive menu and a dynamic routing instance matching the interactive menu according to the authority file.

9. An electronic device, characterized in that: include: A memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is executed.

10. A storage medium, characterized in that: The computer program stored in the storage medium can be executed by one or more processors, and the computer program can be used to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Dynamic routing permission configuration method and device, computer equipment and storage medium

    CN116389129A