Method, device, storage medium and electronic equipment for processing permission information
By establishing a full-duplex communication connection between the front-end and back-end, and monitoring and updating permission information in real time, the problem of static configuration and poor real-time performance in traditional permission control is solved. This enables flexible permission management and efficient permission activation, and is suitable for processing permission information for multiple organizations and multiple users.
Patent Information
- Application Number
- CN202410443449.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-12
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-04-12
AI Technical Summary
In front-end development scenarios, traditional access control suffers from static configuration limitations, cumbersome permission configuration, high coupling between front-end and back-end, and poor real-time performance. As a result, changes to user permissions require users to log in again or refresh the page for the changes to take effect, making it difficult to flexibly respond to dynamic changes in user permissions.
Initial permission information is obtained through the backend interface of the target application system. A connection between the frontend and the backend is established using a full-duplex communication protocol. Permission changes are monitored in real time and updates are pushed. Frontend routing information is dynamically updated based on a state management tool. Modular design and configuration file management of permissions are adopted to achieve flexible configuration and real-time updates of frontend routing.
It improves the efficiency of permission information activation, reduces the need for re-login, enhances the system's real-time performance and user experience, supports independent permission management in multi-organizational collaboration scenarios, and enhances the system's scalability and maintainability.
Smart Images

Figure CN118337439B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology or other related technical fields, in particular, to a permission information processing method and device, a storage medium and an electronic device. BACKGROUND
[0002] Currently, the permission management involving multiple institutions or multiple users is one of the challenges faced by many systems and applications. In particular, in the financial field, the complex combination of different institutions (for example, different branch institutions in a financial institution), user roles and permissions, the flexible and secure permission control of the front-end route becomes crucial.
[0003] In the related art, in the front-end development scenario, the permission control is usually in the static code in the back-end, and the front-end obtains the permission information of the user through the back-end interface. However, with the increase of the complexity of the front-end application and the improvement of the requirement for user experience, the front-end route permission control has some common shortcomings, which are as follows:
[0004] 1. Limitation of static configuration: The traditional front-end route permission control is usually statically set in the back-end code, that is, the user permission information is obtained from the back-end when the application starts, and the update of the permission needs to reload the entire application. This is difficult to flexibly respond to the dynamic changes of user permissions, especially in the scenario of system involving multiple institutions cooperation, the efficiency of the new permission taking effect is lower.
[0005] 2. Complicated permission configuration: With the increase of the complexity of the front-end application, the permission configuration may become complicated. A large amount of permission information is manually managed through the code, which is prone to configuration errors and is not conducive to maintenance.
[0006] 3. Coupling between front-end and back-end: The traditional permission control usually depends on the permission information returned by the back-end interface, resulting in high coupling degree between the front-end and the back-end. The front-end needs to understand the data structure of the back-end, which limits the independence of the front-end and back-end development.
[0007] 4. Poor real-time performance: Most front-end applications only obtain permission information when the user logs in, and do not actively query or update the permission thereafter, resulting in poor real-time performance. This will cause the user to need to log in again or refresh the page after the permission is changed to take effect.
[0008] At present, there is no effective solution to the above problems. SUMMARY
[0009] The embodiments of the present application provide a permission information processing method and device, a storage medium and an electronic device to at least solve the technical problem that in the related art, the user needs to log in again to the system after the permission is changed, and the latest permission can take effect.
[0010] According to an aspect of some embodiments of the present application, a method for processing permission information is provided. The method comprises: in response to detecting an initialization of a target application system, obtaining initial permission information of a target object from a backend of the target application system via an interface of the backend, wherein the initial permission information is used to record access permissions of the target object to each page in the target application system; determining routing information of the target object based on the initial permission information, wherein the routing information comprises routing information of a page in the target application system to which the target object has access permissions; after the initial permission information recorded in the backend is changed, obtaining the changed initial permission information via a target connection, wherein the target connection comprises a connection between a frontend and the backend of the target application system established based on a full-duplex communication protocol of a transmission control protocol; and updating the routing information of the target object based on the changed initial permission information.
[0011] Further, before the initial permission information recorded in the backend is changed, listening to whether the initial permission information in the backend is changed based on a preset trigger condition via the target connection; and after the initial permission information recorded in the backend is changed, receiving the changed initial permission information pushed by the backend to the frontend via the target connection.
[0012] Further, updating the routing information of the target object based on the changed initial permission information comprises: determining a state management tool, wherein the state management tool is used to manage access permissions of the target object to each page in the target application system at the frontend; and updating the routing information of the target object via the state management tool based on the changed initial permission information.
[0013] Further, after obtaining the initial permission information of the target object from the backend of the target application system via the interface of the backend in response to detecting the initialization of the target application system, the method further comprises: in response to an access request of the target object to a first page of the target application system, determining whether the target object has access permissions to the first page based on the routing information of the target object via a routing navigation guard, wherein the routing navigation guard is used to control page jumping; in response to the target object having access permissions to the first page, jumping to the first page; and in response to the target object not having access permissions to the first page, jumping to a second page of the target application system, wherein the second page comprises at least one of an error page and a login page.
[0014] Further, before obtaining the initial permission information of the target object from the backend, the method further comprises: splitting the initial permission information to obtain split initial permission information; and storing the split initial permission information in a plurality of modules of the backend, wherein the plurality of modules are configured to independently manage the split initial permission information.
[0015] Further, before obtaining the initial permission information of the target object from the backend, the method further comprises: detecting whether the front end is opened by the target object; in the case that the target object opens the front end, initializing the target application system and establishing the target connection between the front end and the backend.
[0016] According to another aspect of the embodiments of the present application, a method for processing permission information is also provided, comprising: in the case that it is detected that a target application system is initialized, sending initial permission information of a target object to a front end of the target application system by using an interface of a backend of the target application system, wherein, after the initial permission information is received by the front end, based on the initial permission information, routing information of the target object is determined, the initial permission information is used to record access permissions of the target object to each page in the target application system, and the routing information comprises a route of a page in the target application system that the target object has access permissions; after the initial permission information recorded in the backend is changed, the changed initial permission information is sent to the front end by using a target connection, wherein, after the changed initial permission information is received by the front end, based on the changed initial permission information, the routing information of the target object is updated, and the target connection comprises a connection between the front end and the backend of the target application system established based on a full-duplex communication protocol of a transmission control protocol.
[0017] According to another aspect of the embodiments of the present application, a processing device based on permission information is also provided, comprising: a first obtaining unit, configured to, when detecting that a target application system is initialized, obtain initial permission information of a target object from a backend of the target application system by using an interface of the backend, wherein the initial permission information is used to record access permissions of the target object to each page in the target application system; a determining unit, configured to determine routing information of the target object based on the initial permission information, wherein the routing information comprises routing information of a page in the target application system to which the target object has access permission; a second obtaining unit, configured to, after the initial permission information recorded in the backend is changed, obtain the changed initial permission information by using a target connection, wherein the target connection comprises a connection between a frontend and the backend of the target application system established based on a full-duplex communication protocol of a transmission control protocol; and an updating unit, configured to update the routing information of the target object based on the changed initial permission information.
[0018] Further, the processing device based on permission information further comprises: a listening unit, configured to, before the initial permission information recorded in the backend is changed, listen to whether the initial permission information in the backend is changed based on a preset trigger condition by using the target connection; and a receiving unit, configured to, after the initial permission information recorded in the backend is changed, receive the changed initial permission information pushed by the backend to the frontend by using the target connection.
[0019] Further, the updating unit comprises: a determining subunit, configured to determine a state management tool, wherein the state management tool is used to manage access permissions of the target object to each page in the target application system in the frontend; and an updating subunit, configured to update the routing information of the target object by using the state management tool based on the changed initial permission information.
[0020] Further, the processing apparatus based on permission information further comprises: a judgment unit, configured to, in a case where it is detected that the target application system is initialized, after obtaining initial permission information of a target object from a backend of the target application system by using an interface of the backend, respond to an access request of the target object to a first page of the target application system, and judge whether the target object has access permission to the first page based on route information of the target object by using a route navigation guard, wherein the route navigation guard is used to control jumping between pages; a first jumping unit, configured to, in a case where the target object has access permission to the first page, jump to the first page; and a second jumping unit, configured to, in a case where the target object does not have access permission to the first page, jump to a second page of the target application system, wherein the second page comprises at least one of an error page and a login page.
[0021] Further, the processing apparatus based on permission information further comprises: a splitting unit, configured to, before obtaining initial permission information of a target object from the backend, split the initial permission information to obtain split initial permission information; and a storage unit, configured to store the split initial permission information in a plurality of modules of the backend, wherein the plurality of modules are used to independently manage the split initial permission information.
[0022] Further, the processing apparatus based on permission information further comprises: a detection unit, configured to, before obtaining initial permission information of a target object from the backend, detect whether the frontend is opened by the target object; and a processing unit, configured to, in a case where the target object opens the frontend, initialize the target application system and establish the target connection between the frontend and the backend.
[0023] According to another aspect of the embodiments of the present application, there is also provided a processing apparatus based on permission information, comprising: a first sending unit configured to, in a case where it is detected that a target application system is initialized, send initial permission information of a target object to a front end of the target application system by using an interface of a back end of the target application system, wherein, after the initial permission information is received by the front end, routing information of the target object is determined based on the initial permission information, the initial permission information is used to record access permission of the target object to each page in the target application system, and the routing information comprises a route of a page in the target application system that the target object has access permission to; and a second sending unit configured to, after the initial permission information recorded in the back end is changed, send the changed initial permission information to the front end by using a target connection, wherein, after the changed initial permission information is received by the front end, the routing information of the target object is updated based on the changed initial permission information, and the target connection comprises a connection between the front end and the back end of the target application system established based on a full-duplex communication protocol of a transmission control protocol.
[0024] According to another aspect of the embodiments of the present application, there is also provided an electronic device, comprising: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned processing methods of permission information by executing the executable instructions.
[0025] According to another aspect of the embodiments of the present application, there is also provided a computer readable storage medium storing a computer program, wherein the computer program, when executed, controls a device where the computer readable storage medium is located to execute any one of the above-mentioned processing methods of permission information.
[0026] In the present application, in the case of detecting the initialization of the target application system, the initial permission information of the target object is obtained from the backend by using the interface of the backend of the target application system, wherein the initial permission information is used to record the access permission of the target object to each page in the target application system; based on the initial permission information, the routing information of the target object is determined, wherein the routing information includes: the routing information of the page in the target application system which the target object has access permission; after the initial permission information recorded in the backend is changed, the changed initial permission information is obtained by using the target connection, wherein the target connection includes: the connection between the front end and the backend of the target application system established based on the full-duplex communication protocol of the transmission control protocol; and the routing information of the target object is updated based on the changed initial permission information. Further, the technical problem that the user needs to log in the system again after the user permission is changed, and the latest permission can take effect is solved. In the present application, the changed initial permission information is pushed to the front end through the target connection, and the routing information in the front end is updated in time. The situation that the latest permission information can take effect only after logging in the system again after each change of the permission information is avoided, thereby realizing the technical effect of improving the efficiency of the latest permission information. BRIEF DESCRIPTION OF DRAWINGS
[0027] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the principles of the present application, and do not limit the present application in any manner. In the drawings:
[0028] Figure 1 is a flowchart of an optional permission information processing method according to an embodiment of the present application;
[0029] Figure 2 is a flowchart of another optional permission information processing method according to an embodiment of the present application;
[0030] Figure 3 is a flowchart of an optional permission information update according to an embodiment of the present application;
[0031] Figure 4 is a schematic diagram of an optional permission information processing device according to an embodiment of the present application;
[0032] Figure 5 is a schematic diagram of another optional permission information processing device according to an embodiment of the present application;
[0033] Figure 6 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work should fall within the protection scope of the present application.
[0035] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in other than the order illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a list of steps or units need not be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to such processes, methods, products or devices.
[0036] It should be noted that the processing method, device, storage medium and electronic device of the permission information in the present application can be used in the case of processing the permission information of multiple institutions and multiple users in the field of financial technology, and can also be used in the case of processing the permission information of multiple institutions and multiple users in any field other than the field of financial technology. The application field of the processing method, device, storage medium and electronic device of the permission information in the present application is not limited.
[0037] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.), collected information and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards in relevant regions, necessary security measures are taken, public order and good customs are not violated, and corresponding operation entrances are provided for users to choose authorization or refusal.
[0038] For ease of description, some terms or names related to the embodiments of the present application are explained as follows:
[0039] WebSocket: a network transmission protocol that can conduct full-duplex communication on a single TCP (Transmission Control Protocol, TCP for short) connection, located in the application layer of the OSI (Open Systems Interconnect, OSI for short) model. WebSocket can make data exchange between the client and the server more simple, allowing the server to actively push data to the client. In the WebSocket API (a protocol for bidirectional communication between a web browser and a server), the browser and the server only need to complete a handshake, and a persistent connection can be created between the two for bidirectional data transmission.
[0040] Router navigation guard: mainly used to guard navigation by jumping or canceling. There are multiple opportunities to implant the router navigation process: globally, individually for a single route, or at the component level.
[0041] Embodiment one
[0042] According to the embodiment of the application, an optional method for processing permission information is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.
[0043] Figure 1 is a flowchart of an optional method for processing permission information according to an embodiment of the application, as shown in Figure 1 The method comprises the following steps:
[0044] Step S101, in the case of detecting the initialization of the target application system, the interface of the target application system backend is used to obtain the initial permission information of the target object from the backend, wherein the initial permission information is used to record the access permission of the target object to each page in the target application system.
[0045] The above-mentioned target application system can include a system involving the permissions of multiple institutions and multiple users, and the multiple institutions can refer to multiple branch institutions under an institution, for example, multiple branches of a bank, and users of different branches can have different access permissions to the target application system. In the case of detecting the initialization of the target application system, the initial permission information of the target object can be obtained from the backend through the interface of the front end and the back end of the target application system. The above-mentioned initial permission information adopts modular design, and the permission information is divided into different modules, and the permission information of different modules is independently managed, thereby improving the scalability and maintainability of the system.
[0046] Step S102: Based on the initial permission information, determine the routing information of the target object, wherein the routing information includes: the routing information of the pages in the target application system that the target object has access to.
[0047] In this embodiment, the routing for the target object to access the target application system's pages can be initialized. The front-end routing can be initialized based on the initial permission information, that is, the routing for the target application system's pages that the target object has permission to access can be determined.
[0048] After the initial permission information recorded in the backend is changed in step S103, the changed initial permission information is obtained using the target connection. The target connection includes a connection between the frontend and backend of the target application system established based on the full-duplex communication protocol of the transmission control protocol.
[0049] The aforementioned target connection can be a connection between the front-end and back-end of the target application system established based on the full-duplex communication protocol of the Transmission Control Protocol, referred to as a WebSocket connection. Based on the WebSocket connection, it is possible to listen for permission change events on the back-end. When the permissions on the back-end change, the latest permission information can be pushed to the front-end through the WebSocket connection, that is, the changed initial permission information can be pushed to the front-end through the WebSocket connection.
[0050] It should be noted that in this embodiment, the permission information of the front-end routing can be decoupled from the static code by passing values through the back-end interface. The permission information in the front-end can be dynamically updated by using WebSocket connection and passing values through the interface, making the permission information of the front-end routing more flexible and easier to maintain and manage.
[0051] In one alternative example, changes to initial permission information can be made by managing and updating permission information through configuration file modifications, without delving into the code, thus improving system maintainability.
[0052] Step S104: Update the routing information of the target object based on the changed initial permission information.
[0053] To avoid the situation in related technologies where a system restart is required for the latest permission information to take effect after permission changes, this embodiment updates the routing information of the target object in the front end when the front end receives the changed initial permission information sent by the back end, thereby improving the efficiency of permission information updates.
[0054] Through the above steps, in this embodiment, the changed initial permission information is pushed to the front end through the target connection, and the routing information in the front end is updated in a timely manner. The need for re-login to the system after each change of permission information to make the latest permission information effective is avoided, thereby achieving the technical effect of improving the effectiveness of the latest permission information. Further, the technical problem that the user needs to re-login to the system after the user permission is changed to make the latest permission effective is solved.
[0055] Optionally, before the initial permission information recorded in the back end is changed, based on a preset trigger condition, the initial permission information in the back end is listened to by using the target connection to determine whether the initial permission information in the back end is changed; after the initial permission information recorded in the back end is changed, the changed initial permission information pushed by the back end to the front end is received by using the target connection.
[0056] The preset trigger condition can include a timing or other trigger condition. In order to avoid the need to restart the system to obtain the latest permission information after the permission is changed in the related art. In this embodiment, a trigger condition (corresponding to the preset trigger condition) can be set, and in the target application system, when a specific event meets the preset trigger condition, the back end can query the latest permission information. The front end and the back end can also be connected through a WebSocket connection (corresponding to the target connection) to listen to the permission change event. When the permission is changed, the back end can push the latest permission information (corresponding to the changed initial permission information) to the front end through the WebSocket connection. The front end can receive the latest permission information pushed by the back end, achieving the purpose of real-time updating of the permission. The target application system can query the latest permission information from the back end at a timing or under a trigger condition, so that the front end can obtain and update the user's permission in real time, improving the response speed of the user in the target application system after the permission is changed, and improving the real-time performance of the system.
[0057] Optionally, updating the routing information of the target object based on the changed initial permission information includes: determining a state management tool, wherein the state management tool is used to manage the access permission of each page in the target application system accessed by the target object in the front end; and updating the routing information of the target object by using the state management tool based on the changed initial permission information.
[0058] The state management tool can include a Vuex state management tool or other state management tools, and can be used to manage access permissions of each page in the target application system accessed by the target object on the front end. In this embodiment, the front end can manage the permission information through the state management tool. When the permission information changes, the data in the permission management module of the front end is updated in a timely manner, that is, the routing information of the target object in the front end is updated, so that the update of the permission information has strong universality and adaptability in different front-end applications. The processing method of the permission information proposed in this embodiment can be integrated into different projects, and the technical effect of improving the universality of the permission information change is achieved.
[0059] Optionally, in the case where it is detected that the target application system is initialized, the initial permission information of the target object is obtained from the backend of the target application system through an interface of the backend, and then the method further includes: in response to an access request of the target object to a first page of the target application system, determining whether the target object has access permission to the first page based on the routing information of the target object by using a routing navigation guard, wherein the routing navigation guard is used to control the jump between pages; in the case where the target object has access permission to the first page, jumping to the first page; in the case where the target object does not have access permission to the first page, jumping to a second page of the target application system, wherein the second page includes at least one of the following: an error page and a login page.
[0060] In this embodiment, the routing navigation guard can be used to determine whether the target object has access permission to the first page based on the permission information of the target object, and the page displayed on the front end of the target application system is updated according to the determination result, and the corresponding route or function is displayed or hidden. For example, if the target object has access permission to the first page, the routing navigation guard can be used to control the target application system to jump to the first page, and if the target object does not have access permission to the first page, the target application system can be redirected to the login page (corresponding to the login page), the error page (corresponding to the error page), or other appropriate pages. The purpose of reflecting the change of the user's permission in the system in the front end in a timely manner without the need for re-login or page refresh, that is, jumping to the corresponding page according to the latest permission information, is achieved, the flexibility of the front-end routing interception is improved, and the user experience is improved.
[0061] Optionally, before obtaining the initial permission information of the target object from the backend, the method further includes: splitting the initial permission information to obtain split initial permission information; and storing the split initial permission information in a plurality of modules of the backend, wherein the plurality of modules are used to independently manage the split initial permission information.
[0062] In the embodiment, the initial permission information is split into different modules by modular design, so that the target application system can better cope with the situation of cooperation of multiple agencies, and the permission information of different modules is independently managed, which can improve the scalability and maintainability of the system.
[0063] In an optional example, the permissions of different attributes can be packaged into different objects according to agencies, users, etc., so as to achieve the purpose of independent management of the initial permission information of different agencies. That is, the embodiment can support independent management of the permission information of different agencies through modular design and dynamic configuration. Considering the situation of multiple user roles, the permission information can be configured differently according to the roles of users. The permission information can also be configured through a configuration file, so that the permission information of the front-end route is more flexible and easy to maintain and manage. Modular design can make the target application system better cope with the situation of cooperation of multiple agencies, and the permission information of different agencies can be independently managed.
[0064] Optionally, before obtaining the initial permission information of the target object from the backend, the method further includes: detecting whether the front-end is opened by the target object; initializing the target application system and establishing a target connection between the front-end and the backend when the target object opens the front-end.
[0065] In the embodiment, whether the front-end is opened by the target object can be detected according to whether the target application system is in a starting state, whether the target object is clicked or whether the target object is logging in the target application system. When the target object opens the front-end, the target application system can be initialized, a specified configuration file can be loaded, and a WebSocket connection between the front-end and the backend can be established, so as to achieve the purpose of establishing a target connection between the front-end and the backend of the target application system and updating the permission information based on the target connection.
[0066] The processing method of permission information provided by the embodiment can dynamically configure permission information, so that the permission configuration of the front-end route is more flexible, for example, the permissions of different institutions and user roles can be easily adjusted through a configuration file without modifying the code, and the flexibility of the system is improved. The real-time permission update mechanism is introduced, and the target application system can query the latest permission information from the backend at regular intervals or under triggering conditions, so that the front-end can obtain and update the user's permission in real time, improve the response speed after the user's permission is changed, and improve the real-time performance of the system. Through the real-time permission update mechanism and flexible permission configuration, the user's permission change in the system can be timely reflected in the front-end without re-login or page refresh, and the user's experience is improved. Through modular design and dynamic configuration, the system can support independent management of the permission information of different institutions, adapt to the scene of cooperation of multiple institutions, and improve the universality of the system. Through the configuration file, the permission information of the front-end route is more easy to maintain, and the developer can manage and update the permission by modifying the configuration file without deep code, and the maintainability of the system is improved. Using the state management tool, the processing method of permission information has strong universality and adaptability in different front-ends, and is convenient for integration into different projects.
[0067] Embodiment two
[0068] According to the embodiment of the application, another optional method embodiment of the processing method of permission information is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0069] Figure 2 is a flowchart of another optional processing method of permission information according to the embodiment of the application, as shown in Figure 2 The method comprises the following steps:
[0070] In step S201, when it is detected that the target application system is initialized, the initial permission information of the target object is sent to the front-end of the target application system by using the interface of the back-end of the target application system, wherein after the front-end receives the initial permission information, the route information of the target object is determined based on the initial permission information, and the initial permission information is used to record the access permission of the target object to each page in the target application system, and the route information includes the route of the page in the target application system which the target object has access permission.
[0071] The target application system can include a system related to the rights of multiple institutions and multiple users, the multiple institutions can refer to multiple branch institutions under an institution, for example, multiple branches of a bank, and users of different branches can have different access rights to the target application system. In the case of detecting the initialization of the target application system, the initial right information of the target object can be obtained from the backend through the interface between the front end and the backend of the target application system. The initial right information is designed in a modular manner, and the right information is divided into different modules, and the right information of different modules is independently managed, thereby improving the scalability and maintainability of the system.
[0072] In the embodiment, the route of the target object to access the page of the target application system can be initialized, and the front-end route can be initialized according to the initial right information, that is, the route of the page of the target application system to which the target object has access right is determined.
[0073] In step S202, after the initial right information recorded in the backend is changed, the changed initial right information is sent to the front end by using a target connection. After the changed initial right information is received by the front end, the route information of the target object is updated based on the changed initial right information. The target connection includes a connection between the front end and the backend of the target application system established based on a full-duplex communication protocol of a transmission control protocol.
[0074] The target connection can be a connection between the front end and the backend of the target application system established based on a full-duplex communication protocol of a transmission control protocol, which is referred to as a WebSocket connection. Based on the WebSocket connection, the right change event of the backend can be listened to, and the latest right information can be pushed to the front end by the backend through the WebSocket connection when the right is changed, that is, the changed initial right information is pushed to the front end.
[0075] It should be noted that in the embodiment, the right information of the front-end route can be decoupled from the static code by the backend interface value transmission mode. The right information in the front end can also be dynamically updated by using the WebSocket connection through the interface value transmission, so that the right information of the front-end route is more flexible and easy to maintain and manage.
[0076] In an optional example, the change of the initial right information can include managing and updating the right information by modifying a configuration file without deepening the code, thereby improving the maintainability of the system.
[0077] In order to avoid the case that in the related art, the system needs to be restarted after the right is changed, and the latest right information takes effect, in the embodiment, the route information of the target object in the front end can be updated when the changed initial right information sent by the backend is received by the front end, thereby achieving the technical effect of improving the right information update efficiency.
[0078] Through the above steps, the technical problem that after the user permission is changed, the user needs to log in the system again, and the latest permission can take effect is further solved. In the embodiment, the changed initial permission information is pushed to the front end through the target connection, and the routing information in the front end is updated in a timely manner. The situation that after the permission information is changed each time, the user needs to log in the system again, and the latest permission information can take effect is avoided, so that the technical effect of improving the effectiveness of the latest permission information is realized.
[0079] In the embodiment, the permission information can be dynamically configured. For example, the permission information of the front-end routing can be decoupled from the static code by the way of transmitting values through the back-end interface, and the permission information of the front-end routing is dynamically updated by transmitting values through the interface, so that the permission information of the front-end routing is more flexible and easy to maintain and manage. In the embodiment, the permission information can also be modularly designed. For example, the permission information can be split into different modules by modular design, so that the system (i.e., the target application system) can better cope with the situation of cooperation of multiple institutions, the permission information of different modules is independently managed, and the scalability and maintainability of the system are improved. In the embodiment, a real-time permission updating mechanism can also be set. For example, the latest permission information is queried from the back end through WebSocket or a triggering condition, and the front end listens to the permission change event. Once the new permission information is received, the data in the permission management module is updated in real time.
[0080] In the embodiment, routing interception and permission judgment can also be performed. For example, in the routing navigation guard, whether the user has the permission to access a certain route is judged by the data of the permission management module. If the user does not have the permission, the user can be redirected to a login page, an error page, or other appropriate pages. The processing method of the permission information provided in the embodiment can be applied to a multi-institution and multi-user scenario. For example, the modular design and dynamic configuration can support independent management of the permission information of different institutions, and the permission information can be configured differently according to the roles of the users, considering the situation of multiple user roles. In the embodiment, the permission information of the front-end routing can also be made more flexible and easy to maintain and manage by the way of configuration file, and the modular design helps to cope with the cooperation of multiple institutions, and the permission information of different institutions can be independently managed.
[0081] Figure 3 is a flowchart of an optional permission information updating according to an embodiment of the application. The following will be illustrated by an example of the flow of the permission information updating. Figure 3
[0082] (1) Initialization: The user opens the front-end application. The system is initialized, the configuration file is loaded, and the WebSocket connection (corresponding to the target connection) is established.
[0083] (2) Obtain initial permission information: When the user logs in or the application initializes, the initial permission information of the user can be obtained through the backend interface.
[0084] (3) Route initialization: According to the initial permission information, initialize the front-end route (corresponding to the route information).
[0085] (4) Trigger permission update: Set a trigger condition to query the latest permission information from the backend when a specific event is triggered.
[0086] (5) WebSocket real-time permission update: The user establishes a WebSocket connection to listen to permission change events. When the backend has a permission change event (such as Figure 3 WebSocket has a permission change event), it pushes the latest permission information through WebSocket.
[0087] (6) Front-end permission management: The front-end manages permission information through state management tools. When the permission changes, update the data in the permission management module in time (such as Figure 3 Update the front-end permission route in ).
[0088] (7) Route interception and permission judgment: In the route navigation guard, through the data of the permission management module, judge whether the user has the permission to access a certain route.
[0089] (8) Update the user interface: According to the permission judgment result, update the user interface, and show or hide the corresponding route or function.
[0090] Through this embodiment, the user's permission change in the system can be timely reflected in the front-end, without the need to re-login or refresh the page, achieving the purpose of shortening the effective time of permission information and improving user experience.
[0091] The processing method of the permission information provided by the embodiment can dynamically configure the permission information, so that the permission configuration of the front-end routing is more flexible, for example, the permissions of different institutions and user roles can be easily adjusted through the configuration file without modifying the code, and the flexibility of the system is improved. The real-time permission update mechanism is introduced, and the target application system can query the latest permission information from the backend at regular intervals or under the triggering condition, so that the front-end can obtain and update the user's permission in real time, improve the response speed after the user's permission is changed, and improve the real-time performance of the system. Through the real-time permission update mechanism and flexible permission configuration, the user's permission change in the system can be timely reflected in the front-end without re-login or page refresh, and the user's experience is improved. Through modular design and dynamic configuration, the system can support independent management of the permission information of different institutions, adapt to the scene of multi-institution cooperation, and improve the universality of the system. Through the configuration file, the permission information of the front-end routing is more easy to maintain, and the developer can manage and update the permission by modifying the configuration file without deep code, and the maintainability of the system is improved. Using the state management tool, the processing method of the permission information has strong universality and adaptability in different front-ends, and is convenient for integration into different projects.
[0092] Embodiment three
[0093] The embodiment three of the application provides an optional processing device based on permission information, and each implementation unit in the processing device corresponds to each implementation step in the embodiment one.
[0094] Figure 4 It is a schematic diagram of an optional processing device based on permission information according to the embodiment of the application, as shown in Figure 4 The processing device comprises a first acquisition unit 41, a determination unit 42, a second acquisition unit 43 and an update unit 44.
[0095] The first acquisition unit 41 is configured to acquire initial permission information of a target object from the backend by using an interface of a backend of a target application system when it is detected that the target application system is initialized, wherein the initial permission information is used to record access permissions of the target object to each page in the target application system.
[0096] The determination unit 42 is configured to determine routing information of the target object based on the initial permission information, wherein the routing information comprises routing information of a page in the target application system that the target object has access permissions.
[0097] The second acquisition unit 43 is configured to acquire the changed initial permission information by using a target connection after the initial permission information recorded in the backend is changed, wherein the target connection comprises a connection between a front-end and the backend of the target application system established based on a full-duplex communication protocol of a transmission control protocol.
[0098] The updating unit 44 is configured to update the routing information of the target object based on the changed initial permission information.
[0099] In the processing device based on permission information provided in the third embodiment of the present application, the first obtaining unit 41 is configured to obtain the initial permission information of the target object from the backend through the interface of the backend of the target application system when it is detected that the target application system is initialized, wherein the initial permission information is used to record the access permission of the target object to each page in the target application system, the determining unit 42 is configured to determine the routing information of the target object based on the initial permission information, wherein the routing information includes the routing information of the page in the target application system to which the target object has access permission, the second obtaining unit 43 is configured to obtain the changed initial permission information through the target connection after the initial permission information recorded in the backend is changed, wherein the target connection includes the connection between the front end and the backend of the target application system established based on the full-duplex communication protocol of the transmission control protocol, and the updating unit 44 is configured to update the routing information of the target object based on the changed initial permission information. Thus, the technical problem that the user needs to log in the system again after the permission is changed and the latest permission information takes effect is solved. In this embodiment, the changed initial permission information is pushed to the front end through the target connection, and the routing information in the front end is updated in time. The situation that the user needs to log in the system again after the permission information is changed and the latest permission information takes effect is avoided, and the technical effect of improving the efficiency of the latest permission information is achieved.
[0100] Optionally, in the processing device based on permission information provided in the third embodiment of the present application, the processing device based on permission information further includes a listening unit configured to listen to whether the initial permission information in the backend is changed based on a preset trigger condition through the target connection before the initial permission information recorded in the backend is changed, and a receiving unit configured to receive the changed initial permission information pushed to the front end by the backend through the target connection after the initial permission information recorded in the backend is changed.
[0101] Optionally, in the processing device based on permission information provided in the third embodiment of the present application, the updating unit includes a determining subunit configured to determine a state management tool, wherein the state management tool is used to manage the access permission of the target object to each page in the target application system in the front end, and an updating subunit configured to update the routing information of the target object through the state management tool based on the changed initial permission information.
[0102] Optionally, in the processing apparatus based on the permission information provided in the third embodiment of the present application, the processing apparatus based on the permission information further comprises: a judging unit, configured to, in response to a request of the target object for accessing a first page of the target application system, after obtaining the initial permission information of the target object from the backend by using an interface of a backend of the target application system in a case that it is detected that the target application system is initialized, judge whether the target object has an access right to the first page by using a route navigation guard based on route information of the target object, wherein the route navigation guard is configured to control a jump between pages; a first jump unit, configured to jump to the first page in a case that the target object has the access right to the first page; and a second jump unit, configured to jump to a second page of the target application system in a case that the target object does not have the access right to the first page, wherein the second page comprises at least one of an error page and a login page.
[0103] Optionally, in the processing apparatus based on the permission information provided in the third embodiment of the present application, the processing apparatus based on the permission information further comprises: a splitting unit, configured to split the initial permission information to obtain split initial permission information before obtaining the initial permission information of the target object from the backend; and a storage unit, configured to store the split initial permission information into a plurality of modules of the backend, wherein the plurality of modules are configured to independently manage the split initial permission information.
[0104] Optionally, in the processing apparatus based on the permission information provided in the third embodiment of the present application, the processing apparatus based on the permission information further comprises: a detecting unit, configured to detect whether the frontend is opened by the target object before obtaining the initial permission information of the target object from the backend; and a processing unit, configured to initialize the target application system and establish a target connection between the frontend and the backend in a case that the target object opens the frontend.
[0105] The processing apparatus based on the permission information described above can further comprise a processor and a memory, and the first obtaining unit 41, the determining unit 42, the second obtaining unit 43 and the updating unit 44 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize the corresponding functions.
[0106] Embodiment Four
[0107] The fourth embodiment of the present application provides another optional processing apparatus based on permission information, and each implementation unit in the processing apparatus corresponds to each implementation step in the second embodiment.
[0108] Figure 5 is a schematic diagram of another optional processing apparatus based on permission information according to the fourth embodiment of the present application, and the processing apparatus comprises a first sending unit 51 and a second sending unit 52.
[0109] The first sending unit 51 is configured to send initial permission information of the target object to a front end of the target application system by using an interface of a back end of the target application system when it is detected that the target application system is initialized, and the front end determines routing information of the target object based on the initial permission information after receiving the initial permission information, wherein the initial permission information is used to record access permissions of the target object to each page in the target application system, and the routing information includes a route of a page in the target application system that the target object has access permissions.
[0110] The second sending unit 52 is configured to send the changed initial permission information to the front end by using a target connection after the initial permission information recorded in the back end is changed, and the front end updates the routing information of the target object based on the changed initial permission information after receiving the changed initial permission information, wherein the target connection includes a connection between the front end and the back end of the target application system established based on a full-duplex communication protocol of a transmission control protocol.
[0111] In the processing device based on permission information provided in the fourth embodiment, the first sending unit 51 is configured to send initial permission information of the target object to a front end of the target application system by using an interface of a back end of the target application system when it is detected that the target application system is initialized, and the front end determines routing information of the target object based on the initial permission information after receiving the initial permission information, wherein the initial permission information is used to record access permissions of the target object to each page in the target application system, and the routing information includes a route of a page in the target application system that the target object has access permissions, and the second sending unit 52 is configured to send the changed initial permission information to the front end by using a target connection after the initial permission information recorded in the back end is changed, and the front end updates the routing information of the target object based on the changed initial permission information after receiving the changed initial permission information, wherein the target connection includes a connection between the front end and the back end of the target application system established based on a full-duplex communication protocol of a transmission control protocol. Thus, the technical problem that a user needs to log in the system again after the user permission is changed and the latest permission takes effect is solved. In this embodiment, the changed initial permission information is pushed to the front end by using the target connection, and the routing information in the front end is updated in time. Thus, the situation that the user needs to log in the system again after the permission information is changed and the latest permission information takes effect is avoided, and the technical effect of improving the efficiency of the latest permission information is achieved.
[0112] The processing device based on permission information can further include a processor and a memory, and the first sending unit 51 and the second sending unit 52 are stored in the memory as program units, and the processor executes the program units stored in the memory to realize the corresponding functions.
[0113] The processor includes a core, and the core calls corresponding program units in the memory. The core can be set to one or more, and the initial permission information is pushed to the front end through the target connection by adjusting the core parameters, and the routing information in the front end is updated in time. The need to re-login the latest permission information of the system after each change of the permission information to take effect is avoided, thereby achieving the technical effect of improving the effectiveness of the latest permission information.
[0114] The memory can include a non-permanent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory includes at least one memory chip.
[0115] According to another aspect of the embodiment of the present application, an electronic device is also provided, which includes a processor and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the processing method of the permission information of any one of the above by executing the executable instructions.
[0116] According to another aspect of the embodiment of the present application, a computer readable storage medium is also provided, which stores a computer program, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to execute the processing method of the permission information of any one of the above when the computer program is running.
[0117] Figure 6 is a schematic diagram of an electronic device according to an embodiment of the present application, as shown in Figure 6 The embodiment of the present application provides an electronic device 60, which includes a processor, a memory and a program stored in the memory and executable on the processor, and the processor implements the processing method of the permission information of any one of the above when executing the program.
[0118] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0119] In the above-mentioned embodiments of the present application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0120] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented by other means. Among them, the above-mentioned device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division mode, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.
[0121] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0122] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0123] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for making a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and various program code storage media.
[0124] The above is only the preferred embodiment of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should be considered as the protection scope of the present application.
Claims
1. A method of processing rights information, characterized by, The method comprises the following steps: In the case of detecting the initialization of the target application system, the initial permission information of the target object is obtained from the backend of the target application system by using the interface of the backend, wherein the initial permission information is used to record the access permission of the target object to each page in the target application system; Based on the initial permission information, the routing information of the target object is determined, wherein the routing information includes the routing information of the page in the target application system that the target object has access to; After the initial permission information recorded in the backend is changed, the changed initial permission information is obtained by using the target connection, wherein the target connection includes the connection between the front end and the backend of the target application system established based on the full-duplex communication protocol of the transmission control protocol; The routing information of the target object is updated based on the changed initial permission information.
2. The processing method of claim 1, wherein Before the initial permission information recorded in the backend is changed, based on a preset trigger condition, the initial permission information in the backend is listened to by using the target connection to determine whether the initial permission information has been changed; After the initial permission information recorded in the backend is changed, the changed initial permission information pushed by the backend to the front end is received by using the target connection.
3. The treatment method of claim 1, wherein Updating the routing information of the target object based on the changed initial permission information comprises: Determining a state management tool, wherein the state management tool is used to manage the access permission of the target object to each page in the target application system in the front end; Based on the changed initial permission information, the routing information of the target object is updated by the state management tool.
4. The treatment method of claim 1, wherein After the initial permission information of the target object is obtained from the backend in the case of detecting the initialization of the target application system, the method further comprises: In response to the access request of the target object to the first page of the target application system, it is judged by using the routing navigation guard whether the target object has access to the first page based on the routing information of the target object, wherein the routing navigation guard is used to control the jump between pages; In the case that the target object has access to the first page, jump to the first page; In the case that the target object does not have access to the first page, jump to the second page of the target application system, wherein the second page includes at least one of the following: error page, login page.
5. The treatment method of claim 1, wherein Before obtaining the initial permission information of the target object from the backend, the method further comprises: The initial permission information is split to obtain the split initial permission information; The split initial permission information is stored in a plurality of modules of the backend, wherein the plurality of modules are used to independently manage the split initial permission information.
6. The treatment method of claim 1, wherein Before obtaining the initial permission information of the target object from the backend, the method further comprises: Detecting whether the front end is opened by the target object; In a case where the target object opens the front end, the target application system is initialized, and the target connection is established between the front end and the back end.
7. A method of processing rights information, characterized by, Comprising: In a case where the target application system is detected to be initialized, initial permission information of a target object is sent to a front end of the target application system by using an interface of a back end of the target application system, wherein, after the initial permission information is received by the front end, routing information of the target object is determined based on the initial permission information, the initial permission information is used to record access permissions of the target object to each page in the target application system, and the routing information comprises a route of a page in the target application system that has access permissions of the target object. After the initial permission information recorded in the back end is changed, the changed initial permission information is sent to the front end by using a target connection, wherein, after the changed initial permission information is received by the front end, the routing information of the target object is updated based on the changed initial permission information, and the target connection comprises a connection between the front end and the back end of the target application system established based on a full-duplex communication protocol of a transmission control protocol.
8. An apparatus for processing rights information, characterized by comprising: Comprising: A first obtaining unit is configured to, in a case where the target application system is detected to be initialized, obtain initial permission information of a target object from a back end of the target application system by using an interface of the back end, wherein the initial permission information is used to record access permissions of the target object to each page in the target application system. A determining unit is configured to determine routing information of the target object based on the initial permission information, wherein the routing information comprises route information of a page in the target application system that has access permissions of the target object. A second obtaining unit is configured to, after the initial permission information recorded in the back end is changed, obtain changed initial permission information by using a target connection, wherein the target connection comprises a connection between a front end and the back end of the target application system established based on a full-duplex communication protocol of a transmission control protocol. An updating unit is configured to update the routing information of the target object based on the changed initial permission information.
9. An apparatus for processing rights information, characterized by A first sending unit is configured to, in a case where the target application system is detected to be initialized, send initial permission information of a target object to a front end of the target application system by using an interface of a back end of the target application system, wherein, after the initial permission information is received by the front end, routing information of the target object is determined based on the initial permission information, the initial permission information is used to record access permissions of the target object to each page in the target application system, and the routing information comprises a route of a page in the target application system that has access permissions of the target object. A second sending unit is configured to send the changed initial permission information to the front end by a target connection after the initial permission information recorded in the back end is changed, and the front end updates routing information of the target object based on the changed initial permission information after receiving the changed initial permission information, and the target connection includes a connection between the front end of the target application system and the back end established based on a full-duplex communication protocol of a transmission control protocol.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program controls a device where the computer readable storage medium is located to execute the processing method of the permission information according to any one of claims 1 to 6 when the computer program is running.
11. An electronic device, comprising: The device comprises one or more processors and a memory for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the processing method of the permission information according to any one of claims 1 to 6.
Citation Information
Patent Citations
Page login method, system and related device
CN111181941A
Web application real-time authority control method, electronic device and storage medium
CN112165449A