Interface permission configuration method, device, electronic device and storage medium
By visually displaying the front-end mapping interface collection in the software system, receiving permission configuration requests and synchronously configuring access permissions, the problem of low efficiency in interface permission configuration is solved and efficient and accurate permission management is achieved.
Patent Information
- Application Number
- CN202410932440.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-12
AI Technical Summary
The existing technology has low efficiency in configuring interface permissions in software systems. Manual input of interface whitelists is heavy workload and error-prone, making it difficult to configure permissions quickly and accurately.
By visually displaying the front-end identifiers in the front-end mapping interface set in the software system, receiving permission configuration requests, determining the mapping relationship between the target front-end identifier and the interface module, synchronously configuring access permissions, and simplifying the interface permission configuration process.
It improves the efficiency of interface permission configuration, reduces technical threshold and maintenance costs, reduces labor costs, and improves the accuracy of permission configuration.
Smart Images

Figure CN118468324B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software technology, and in particular to an interface permission configuration method, device, electronic device and storage medium. Background Art
[0002] In the field of software development, implementing functions with different permissions for different users is an important measure to ensure system security. This requires that the software interface be displayed differently according to the user's permission level. At present, the industry generally adopts the method of manual configuration by back-end interface developers when implementing interface permission control for software system users. For example, back-end developers need to enter interfaces one by one according to the user's permission level to register the list of interfaces allowed to be accessed (i.e., whitelist).
[0003] However, with the continuous expansion of software system functions and the complexity of user permissions, the workload of this method will increase dramatically. It is difficult to quickly and accurately configure the interface permissions of the software system by manually entering the interface to determine the whitelist. Therefore, there is currently a technical problem of low efficiency in configuring the interface permissions of the software system. Summary of the invention
[0004] The main purpose of the present invention is to provide an interface permission configuration method, device, electronic device and storage medium, aiming to solve the technical problem of low efficiency of interface permission configuration of software system.
[0005] To achieve the above object, the present invention provides an interface authority configuration method, the interface authority configuration method comprising:
[0006] Visually display each front-end identifier in the front-end mapping interface set in the software system;
[0007] Receiving an external permission configuration request input based on each of the front-end identifiers of the visual display;
[0008] Determine the target front-end identifier specified by the permission configuration request, and the target interface module in the front-end mapping interface set that has a mapping relationship with the target front-end identifier;
[0009] According to the permission configuration request, the access rights of the target front-end identifier are configured to synchronously configure the access rights of the target interface module.
[0010] In one embodiment, the front-end mapping interface set includes a page mapping interface set and an element mapping interface set, the front-end identifier includes a page identifier and a trigger state element identifier, and the interface module includes a first interface and a second interface;
[0011] Before the step of each front-end identifier in the front-end mapping interface set in the visual display software system, the step further includes:
[0012] When the software system is in a test environment, monitoring the front end of the software system;
[0013] In the case where there is a trigger state element whose running state is triggered in the front end, obtain the trigger state element identifier of the trigger state element, intercept the first interface pre-requested call of the trigger state element identifier, and intercept the second interface pre-requested call of the page identifier of the page where the trigger state element is located;
[0014] The trigger state element identifier is associated with the first interface to determine an element mapping interface set, and the page identifier is associated with the second interface to determine a page mapping interface set.
[0015] In one embodiment, when there is a trigger state element whose running state is triggered in the front end, the step of obtaining the trigger state element identifier of the trigger state element includes:
[0016] In the case that there is a triggered web page event on the front end, intercepting the web page event, and determining the trigger state element identifier of the triggered trigger state element from the web page event;
[0017] The web page event includes a first event marked by a first element created by initialization, and / or a second event marked by a second element created by non-initialization.
[0018] In one embodiment, the step of intercepting the first interface called by the trigger state element identification pre-request includes:
[0019] Obtaining the element address of the trigger state element identifier;
[0020] Concatenate the trigger state element identifier and the element address to obtain an element concatenation identifier;
[0021] When the element splicing identifier satisfies a preset first trigger condition, intercepting a first interface called by the element identifier request;
[0022] The preset first trigger condition indicates that the trigger state element corresponding to the element splicing identifier is not repeatedly triggered.
[0023] In one embodiment, the step of intercepting the second interface called by the page identifier pre-request of the page where the trigger state element is located includes:
[0024] When it is detected that the trigger state element is triggered for a preset time, the call request of the trigger state element identifier of the trigger state element to the first interface is reset to the call request of the page identifier of the page where the trigger state element is located to the second interface;
[0025] When the page identifier satisfies a preset second trigger condition, intercepting a second interface of the page identifier;
[0026] The preset second trigger condition indicates that the page identifier is not triggered repeatedly.
[0027] In one embodiment, after the steps of associating the trigger state element identifier with the first interface to determine the element mapping interface set, and associating the page identifier with the second interface to determine the page mapping interface set, the method further includes:
[0028] receiving a calibration request for a target calibration interface in the front-end mapping interface set, and determining calibration indication information from the calibration request;
[0029] The target calibration interface is calibrated according to the calibration instruction information.
[0030] In one embodiment, the method comprises:
[0031] When the front end of the software system detects a newly added front end identifier, obtaining a newly added interface called by the newly added front end identifier request;
[0032] The newly added front-end identifier and the newly added interface are associated and stored in a temporary interface mapping set;
[0033] When a confirmation and addition indication of the temporary interface mapping set is received, the temporary interface mapping set is stored in the front-end mapping interface set.
[0034] In one embodiment, a list of backend interfaces of a software system is periodically scanned;
[0035] A target deletion interface different from the backend interface list is determined from the frontend mapping interface set, and the target deletion interface is deleted to update the frontend mapping interface set.
[0036] The present invention also provides an interface authority configuration device, the device comprising:
[0037] A display module is used to visually display each front-end identifier in the front-end mapping interface set in the software system;
[0038] A receiving module, used for receiving an external permission configuration request input based on each of the front-end identifiers of the visual display;
[0039] A determination module, used to determine the target front-end identifier specified by the permission configuration request, and a target interface module in the front-end mapping interface set that has a mapping relationship with the target front-end identifier;
[0040] A configuration module is used to configure the access rights of the target front-end identifier according to the permission configuration request, so as to synchronously configure the access rights of the target interface module.
[0041] The present invention also provides an electronic device, comprising a memory, a processor, and an interface permission configuration program stored in the memory and executable on the processor, wherein when the interface permission configuration program is executed by the processor, the steps of the interface permission configuration method described above are executed.
[0042] The present invention also provides a computer-readable storage medium, which stores an interface permission configuration program that can be run on a processor, and the interface permission configuration program is called by the processor to implement the steps of the interface permission configuration method as described above.
[0043] The present invention provides an interface permission configuration method, which can at least achieve the following technical effects: the present invention can receive permission configuration requests input from the outside based on each of the front-end identifiers in the visually displayed front-end mapping interface set in the software system by visually displaying the front-end identifiers, and then can perform permission configuration on the target front-end identifier according to the permission configuration request. Moreover, since there is a mapping relationship between the target front-end identifier and the target interface module in the front-end mapping interface set, the permission setting of the target interface module associated with the target front-end identifier can be synchronized by setting the permission of the target front-end identifier. There is no need to manually input the interface to determine the interface whitelist, which simplifies the interface permission configuration process of the software system and improves the efficiency of the interface permission configuration of the software system. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 A schematic diagram of a flow chart of an embodiment of a method for configuring interface permissions of the present invention;
[0047] Figure 2 A schematic diagram of a front-end mapping interface set in another embodiment of the interface authority configuration method of the present invention;
[0048] Figure 3 A flowchart of another embodiment of the method for configuring interface permissions of the present invention;
[0049] Figure 4 A schematic diagram of the module structure of the interface authority configuration device according to an embodiment of the present invention;
[0050] Figure 5 The figure is a schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention.
[0051] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0052] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0053] In the field of software development, implementing different permissions for different users is an important measure to ensure system security. This requirement not only requires that the software interface be displayed differently according to the user's permission level, but also requires that even if a hacker (software attacker) bypasses the front-end interface, the user's permission control can still be achieved.
[0054] At present, the industry generally adopts the following methods to implement software system user interface permission control:
[0055] Backend interface developers manually register a whitelist interface list: This method requires developers to set access permissions for interfaces one by one according to the user's permission level, and maintain a whitelist list containing interfaces that are allowed to be accessed. However, with the continuous expansion of system functions and the complexity of user permissions, the workload of this method will increase dramatically, the maintenance cost is high, and it is prone to errors.
[0056] Manually configure the interface whitelist or blacklist on a visual user permission configuration platform: Although this method provides a certain visual operation interface, it is essentially still a way of manually configuring interface access rights, and it also faces the problems of large workload and difficult maintenance.
[0057] Manually agreeing on the interface permission level and matching it with the user's multi-dimensional permission level: This method attempts to achieve automatic control of interface permissions by defining the interface permission level and matching it with the user's multi-dimensional permission level. However, due to the complexity of user permissions and interface permissions, this method is difficult to implement and difficult to adapt to the needs of system changes.
[0058] Moreover, the technical threshold of the interface permission configuration of the above-mentioned methods is relatively high, and the back-end developers are required to configure the interface. If the relevant configuration personnel are not familiar with the technical details of the back-end interface, it is difficult to accurately configure the back-end interface permissions. In summary, the existing software system user interface permission control scheme has the problems of heavy tasks, high maintenance costs, easy errors, high technical thresholds, etc., and cannot meet the requirements of software systems for security and flexibility.
[0059] In order to overcome the above defects, the present invention realizes the permission configuration of the interface associated with the front-end identifier by performing permission configuration on the front-end identifier by displaying each front-end identifier in the front-end mapping interface set in the software system, thereby eliminating the need to manually input the interface to set the interface whitelist, thereby simplifying the process of interface permission configuration. And because the present invention can support the permission configuration of the interface through the front-end identifier, the relevant personnel who configure the permission of the front-end identifier can realize the permission configuration of the interface without understanding the technical details of the interface, so the present invention also reduces the technical threshold of interface permission configuration.
[0060] Based on this, the present invention proposes an interface authority configuration method according to an embodiment. Figure 1 The interface authority configuration method includes steps S10 to S40:
[0061] Step S10, visually displaying each front-end identifier in the front-end mapping interface set in the software system;
[0062] It should be noted that the execution subject of this embodiment is a software system, which includes a front end and a back end. The front end can display multiple front end logos, and the back end includes multiple interface modules. The front end of the software system is the part that directly interacts with the user of the software system, and the back end of the software system is responsible for data processing, storage, and interaction with the front end. In this embodiment, the front end interface mapping set can be displayed on the front end of the software system. For example, the front end of the software system can include a permission configuration interface, and the front end mapping interface set can be displayed in the permission configuration interface.
[0063] The front-end identifier refers to the identifier of the front-end of the software system that directly interacts with the user. The interface module includes one or more back-end interfaces. The back-end interface is the application programming interface (API) of the software system. The interface is used to process requests sent by the front-end and to transmit data.
[0064] The front-end mapping interface set is characterized by the mapping relationship between each front-end identifier and the corresponding interface module in the software system. The mapping relationship includes one front-end identifier associated with multiple back-end interfaces and / or associated with one back-end interface, and / or, one back-end interface can also be associated with multiple front-end identifiers and / or associated with one front-end identifier. In the software system, including multiple front-end identifiers and multiple interfaces, the front-end mapping interface set can include the mapping relationship corresponding to each front-end identifier.
[0065] In one embodiment, in order to facilitate the permission configuration of all interfaces of the software system backend, the frontend mapping interface set may include the mapping relationship between all frontend identifiers in the software system and the backend interfaces. So that when the permission configuration is performed for any frontend identifier in the software system, the permission configuration of one or more backend interfaces associated with the frontend identifier can be realized through the frontend mapping interface set.
[0066] Exemplarily, the front-end mapping interface set can be displayed on the front-end of the software system, for example, on the interface permission configuration platform of the front-end, and the interface permission configuration can be performed on the interface permission configuration platform. The display method of the front-end mapping interface set on the front-end can be hierarchically displayed according to the hierarchical relationship between the front-end identifiers. In other embodiments, the front-end identifier and the interface module corresponding to the front-end identifier can be associated and displayed.
[0067] Step S20, receiving an external permission configuration request input based on each front-end identifier displayed visually;
[0068] It should be noted that the front-end mapping interface set can be displayed on the display interface of the front end of the software system, and the software system can interface with the permission configuration request triggered by the user on the front end. The external refers to the outside of the software system, and the external can manage the relevant personnel of the software system, such as management personnel, operation and maintenance personnel, etc. The permission configuration request is used to instruct the software system to perform permission configuration. The target front-end identifier that needs to be configured with permissions can be determined from the permission configuration request, and the target permissions of the target front-end identifier can be determined. Exemplarily, the permission configuration request of each front-end identifier in the front-end mapping interface set based on the external visual display is received.
[0069] Step S30, determining the target front-end identifier specified by the permission configuration request, and the target interface module in the front-end mapping interface set that has a mapping relationship with the target front-end identifier;
[0070] It should be noted that the target front-end identifier can be any front-end identifier in the front-end mapping interface set. Multiple target front-end identifiers can be specified simultaneously in the permission configuration request. It can be understood that in the embodiment, the permission configuration of the target front-end identifiers can be performed one by one, or the permission configuration of the target front-end identifiers in batches can be performed.
[0071] Since the front-end mapping interface set includes the mapping relationship between each front-end identifier and their corresponding interface modules, when the target front-end identifier is specified in the permission configuration request, the target interface module corresponding to the target front-end identifier can be determined through the front-end mapping interface set, thereby facilitating subsequent permission configuration through the target front-end identifier to simultaneously configure the target interface module.
[0072] Exemplarily, the target front-end identifier may be determined from the permission configuration request, and a target interface module having a mapping relationship with the target front-end identifier may be searched in the front-end mapping interface set.
[0073] Step S40: According to the permission configuration request, the access rights of the target front-end identifier are configured to synchronously configure the access rights of the target interface module.
[0074] It should be noted that the access right refers to the right of user N to access the target front-end identifier. The access right can be to allow user N to access or to prohibit user N from accessing. User N refers to the user role. N can be a positive integer. The value represented by N is different, and the user role represented by user N can be different.
[0075] The permission configuration request may be a request to configure the target front-end identifier to allow user N to access, and the user role may be a common user role or an administrator role, etc., which is not specifically limited in this embodiment. Common users and software administrators may set different access rights in the software system. The front-end identifiers in the software system that can be accessed by different user roles may be the same or different.
[0076] For the same user role, there may be multiple front-end identifiers that are allowed to be accessed. The interface permission configuration personnel can batch select multiple target front-end identifiers that are allowed to be accessed by the user role, initiate a permission configuration request for the user role, and configure the permissions for multiple target front-end identifiers to synchronously configure the access rights of the interface modules associated with each target front-end identifier. The target interface module includes one or more interfaces in the software system.
[0077] Exemplarily, the permission setting instruction of the permission configuration request is determined, and the access rights of the target front-end identifier are configured according to the permission setting instruction, so as to synchronously configure the access rights of the target interface module associated with the target front-end identifier. The permission setting instruction may be an instruction to set the access rights of the target front-end identifier to allow user N to access, etc.
[0078] The embodiment of the present invention can receive permission configuration requests input from the outside based on the front-end identifiers displayed visually in the front-end mapping interface set in the software system through visual display of each front-end identifier, and then can perform permission configuration on the target front-end identifier according to the permission configuration request. Moreover, since there is a mapping relationship between the target front-end identifier and the target interface module in the front-end mapping interface set, the permission setting of the target interface module associated with the target front-end identifier can be synchronized by setting the permission of the target front-end identifier. There is no need to manually input the interface to determine the interface whitelist, which simplifies the interface permission configuration process of the software system and improves the efficiency of the interface permission configuration of the software system.
[0079] It reduces labor costs and lowers the technical threshold for permission configuration. There is no need for back-end technicians to configure permissions for back-end interfaces, which does not impose unnecessary development burden on developers. It reduces maintenance costs and improves the accuracy of permission configuration.
[0080] For a better understanding of this implementation, refer to Figure 2 ,based on Figure 2 The front-end mapping interface collection shown in the figure briefly describes the process of permission configuration. Figure 2 The diagram in the figure shows the front-end identifier and the interface module in the front-end mapping interface set, except Figure 2 In addition to the displayed form, in other embodiments, it can be displayed in other forms according to the hierarchical relationship of the front-end identifier, and this embodiment does not specifically limit this. Figure 2 The displayed front-end mapping interface set includes a front-end identifier and an interface module. The front-end identifier includes page identifiers Q1, ...Qn; corresponding to the page identifier Qn are trigger-state element identifiers Qnb1, Qnb2, ...Qnbn. For example, the page identifier Q1 corresponds to trigger-state element identifiers Q1b1, Q1b2, ...Q1bn; the interface module includes the second interface H1, ...Hn; and also includes the first interface H1b1, H1b2, ...H1bn, ...Hnbn. n refers to the number, Qn indicates the nth page identifier, Qnbn indicates the nth trigger-state element identifier corresponding to the nth page identifier; Hn is the second interface corresponding to Qn; Hnbn is the first interface corresponding to Qnbn. Among them, Figure 2 The dotted line in refers to the mapping relationship between the front-end identifier and the interface module, J is the interface, and the first interface and the second interface may include multiple interfaces J, or may only include one interface J. When configuring the permissions for the trigger element identifier Q1b1, the first interface H1b1 corresponding to the trigger element identifier Q1b1 will be configured synchronously.
[0081] Further, the front-end mapping interface set includes a page mapping interface set and an element mapping interface set, the front-end identifier includes a page identifier and an element identifier, and the interface module includes a first interface and a second interface; please refer to Figure 3 , before step S10, further comprising steps A10 to A30:
[0082] Step A10, monitoring the front end of the software system when the software system is in a test environment;
[0083] It should be noted that the test environment refers to the software system currently in the test phase, which means that the front-end pages displayed on the front-end of the software system and the elements within the pages are accessible. It can be understood that in the test environment, the permissions of the various front-end identifiers on the software system and the interface modules corresponding to the front-end identifiers are released. In other embodiments, the front-end of the software system can be monitored to intercept the interfaces corresponding to the various front-end identifiers on the front-end of the software system, so as to obtain a set of front-end mapping interfaces.
[0084] The front-end mapping interface set includes a page mapping interface set and an element mapping interface set, and the front-end identification includes a trigger state element identification and a page identification. The page identification refers to the identification of the front-end page displayed on the front-end of the software system, the trigger state element identification refers to the identification of the element in the front-end page, and the trigger state refers to the state of the element. In this embodiment, the trigger state element can refer to the element that is currently being triggered, or it can be an element that has been triggered in the past. Each front-end page can be displayed on the front-end, and the elements in each front-end page can also be displayed on the front-end. In the test environment, each element of the front-end will be triggered. It can be understood that the running state of each element will be triggered, so that each element of the front-end can be fully scanned to obtain the mapping relationship between the trigger state element and the first interface.
[0085] Multiple element identifiers can be displayed in the front-end page. The page mapping interface set includes the mapping relationship between each page identifier and its corresponding interface module, and the element mapping interface set includes the mapping relationship between each trigger state element identifier and its corresponding interface module. The display method of the front-end mapping interface set on the front-end can be hierarchically displayed according to the hierarchical relationship between the front-end identifiers. For example, according to the page mapping interface set, each page identifier and the interface corresponding to the page identifier are displayed, or each page identifier is displayed; under the page identifier, each element identifier in the page identifier and the interface corresponding to each trigger state element identifier can be displayed, or each trigger state element identifier in the page identifier can be displayed.
[0086] Exemplarily, when the front-end identifier of the software system and / or the corresponding interface module have their permissions released, the front-end of the software system is monitored. Permission release means no permission restrictions.
[0087] In a feasible embodiment, step A20 further includes step X10:
[0088] Step X10, when there is a triggered web page event in the front end, intercept the web page event, and determine the triggered element identifier of the triggered trigger element from the web page event;
[0089] The web page event includes a first event marked by a first element created by initialization, and / or a second event marked by a second element created by non-initialization.
[0090] It should be noted that web page events refer to actions triggered when users or browsers interact with page elements. Web page events are usually related to elements of the page, which can be buttons, links, forms, etc. For example, a web page event can be a click event: triggered when a user clicks on a clickable element (such as a button or link) on the page; it can also be a form submission event: triggered when a user submits a form, often used to verify form data, process form data, etc.; it can also be a mouse event, etc.: including mouse press, mouse move, mouse release, etc., usually associated with clickable elements on the page or elements that require mouse interaction. Trigger state elements can be elements such as buttons, links, forms, etc.
[0091] The first element identifier is the element identifier corresponding to the element created by initialization in the page, and the second element identifier is the element identifier corresponding to the element created by non-initialization in the page. Initialization elements usually refer to elements that already exist when the page is loaded, and non-initialization elements refer to elements dynamically created when the page is running. When the initialization elements or non-initialization elements are triggered, the corresponding web page events will be generated. The web page events include the first event and the second event. The first event is the event corresponding to the first element identifier, and the second event is the event corresponding to the second element identifier.
[0092] Exemplarily, it is detected whether there is a triggered web page event in the front end. If there is a triggered web page event in the front end, the web page event is intercepted, and the trigger state element identifier of the triggered trigger state element is determined from the web page event. Generally, the triggered web page event includes a trigger state element identifier. In the case where the web page event is a first event with a first element identifier created by initialization, the first element identifier in the web page event is used as the trigger state element identifier. In the case where the web page event is a second event with a second element identifier created without initialization, the second element identifier in the web page event is used as the trigger state element identifier.
[0093] The step of monitoring whether there is a triggered web page event on the front end can be to configure a listener on the container where the elements are placed in the page to monitor all corresponding elements under the page, thereby eliminating the need to add a listener for each element, reducing the workload, reducing the risk of missing elements to be monitored, and improving the efficiency of monitoring elements.
[0094] Among them, the element identifier can be the identifier corresponding to an element such as a button in the page. When a web page event is detected to be triggered, the web page event is intercepted, and the triggered trigger state element identifier is determined from the web page event, thereby facilitating subsequent interception of the interface corresponding to the trigger state element identifier.
[0095] To better understand this embodiment, the following is a brief code of the monitoring software system front end:
[0096] const buttons = document.querySelectorAll('button');
[0097] / / Listen for the click event of the first element identifier created by initialization
[0098] buttons.forEach(button => {
[0099] button.addEventListener('click', event =>{
[0100] / / Intercept the click event of the first element identifier created by initialization
[0101] Handler.changeEventTarget('button',getIdByTarget(event.target));
[0102] console.log('The button was clicked');
[0103] },true);});
[0104] / / Listen for click events of the second element identifier that is not created by initialization
[0105] document.body.addEventListener('click', event =>{
[0106] if(e.target.tagName =='button'){
[0107] / / Intercept the click event of the second element identifier created by initialization Handler.changeEventTarget('button',getIdByTarget(event.target));
[0108] console.log('The button was clicked');
[0109] }
[0110] },true);
[0111] Among them, const buttons = document.querySelectorAll('button') means to monitor the click event of the first element identifier created by initialization. The element created by initialization corresponding to the first element identifier can be a button; buttons.forEach(button =>{button.addEventListener('click', event => means to intercept the click event of the first element identifier created by initialization. The click event is a type of web page event. The Handler in Handler.changeEventTarget is the intercepted object. "'button',getIdByTarget(event.target)" is equivalent to obtaining the element identifier of the element. The element includes the element created by initialization. console.log('the button was clicked') means that the software system will output the button being clicked in the console of the software system. In this way, the click events of all the first element identifiers created by initialization can be monitored. document.body.addEventListener('click', event =>{if(e.target.tagName =='button')} means to monitor the click event of the second element identifier created by non-initialization. Handler.changeEventTarget('button',getIdByTarget(event.target)); console.log('The button was clicked')}},true); indicates that when the click event of the second element identifier created uninitialized is triggered, the output button is clicked to monitor the click event of the second element identifier created uninitialized. The uninitialized element corresponding to the second element identifier can be a button.
[0112] Among them, the brief code for determining the intercepted object Handler is as follows:
[0113] / / Page interaction type / / const types = ['page', 'button', '...'];
[0114] / / Intercept object / / const Handler = {
[0115] / / How to trigger interface request;
[0116] eventType: types[0],
[0117] / / Record the page ID or trigger element ID in the current interaction;
[0118] targetId: getIdByUrl(location.href),
[0119] / / Return the page ID or trigger element ID in the current interaction;
[0120] getTargetId:(){
[0121] / / Get the corresponding page ID or trigger element ID;
[0122] return this.targetId;},
[0123] / / Modify the method of triggering interface request;
[0124] changeEventTarget:(type,id){
[0125] this.eventType = type;
[0126] this.targetId = id;},
[0127] / / Reset the method of triggering interface request;
[0128] reset:(){this.eventType = types[0];
[0129] / / Get the page ID;
[0130] this.targetId = getIdByUrl(location.href);}}
[0131] / / After the trigger state element is triggered for a preset time, it is reset to the interface call request triggered by the page;
[0132] const debouncedChangeEventType = _.debounce((){
[0133] if(this.eventType == types[1]){Handler.reset();}}, 200);
[0134] The above code content is the code content corresponding to the Handler object. const types = ['page', 'button', '…'] refers to the page interaction type. The page interaction type can be a page or a button. The button is a type of trigger state element. const Handler is the interception object. The code content in {} of const Handler is the description of the interception object, including: eventType: types[0] indicates the way to trigger the interface request (page or other element event trigger); targetId: getIdByUrl(location.href) indicates recording the page ID or trigger element ID in the current interaction, getTargetId:() indicates returning the page ID or trigger element ID in the current interaction; return this.targetId indicates obtaining the corresponding page ID or trigger element ID; changeEventTarget:(type,id){this.eventType = type;this.targetId= id;} indicates modifying the way to trigger the interface request; reset:(){ this.eventType = types[0] indicates resetting the way to trigger the interface request; this.targetId = getIdByUrl(location.href) indicates obtaining the page ID. Both the page ID and the trigger element ID can be interception objects. The above code content defines the interception object Handler, so that when monitoring the front end of the software system, when it is detected that the Handler needs to be intercepted, the corresponding interception object can be obtained.
[0135] constdebouncedChangeEventType=_.debounce((){if(this.eventType ==types[1]){Handler.reset();}}, 200) indicates that after the trigger state element is triggered for a preset time, it is reset to the interface call request triggered by the page, that is, it is reset to the call request of the page identifier to the second interface.
[0136] Step A20, when there is a triggering state element whose running state is triggered in the front end, obtain the triggering state element identifier of the triggering state element, intercept the first interface pre-requested by the triggering state element identifier, and intercept the second interface pre-requested by the page identifier of the page where the triggering state element is located;
[0137] It should be noted that the monitoring front end can be each element identifier corresponding to the monitoring front end. The first interface is characterized by one or more interfaces that need to be called by the trigger state element corresponding to the trigger state element identifier. The interface called by the element corresponding to the trigger state element identifier when it is triggered can be one or more. The second interface is one or more interfaces that need to be called when the page corresponding to the page identifier is triggered.
[0138] It can be understood that the first interface of the trigger element identifier is intercepted by monitoring whether there is a triggered web page event on the front end, and the second interface of the page identifier is intercepted after intercepting the first interface of the trigger element identifier in the page corresponding to the page identifier.
[0139] Exemplarily, when there is a trigger state element in the front end whose running state is triggered, the trigger state element identifier of the trigger state element is obtained, the first interface pre-requested to be called by the trigger state element identifier is intercepted, and the second interface pre-requested to be called by the page identifier of the page where the trigger state element is located is intercepted. The first interface can be displayed as an interface list, and the second interface can also be displayed as an interface list.
[0140] In a feasible embodiment, step A20 also includes steps A21 to A23:
[0141] Step A21, obtaining the element address of the trigger state element identifier;
[0142] Step A22, splicing the contact state element identifier and the element address to obtain the element splicing identifier;
[0143] Step A23, when the element splicing identifier meets the preset first trigger condition, the triggered element identifier and the corresponding first interface are associated and stored in the element mapping interface set;
[0144] The preset first trigger condition indicates that the trigger state element corresponding to the element splicing identifier is not repeatedly triggered.
[0145] It should be noted that in order to avoid frequent interception of the trigger state element identifier and the corresponding first interface, which may cause overload of the software system, this embodiment determines whether the trigger state element is repeatedly triggered, and only intercepts the first interface corresponding to the element when the trigger state element is not repeatedly triggered.
[0146] The element address refers to the URL address of the trigger element. The trigger element identifiers of each trigger element in the same page are unique, but the trigger element identifiers corresponding to trigger elements in different pages may not be unique, so it is necessary to combine the trigger element identifier and the element address to determine whether the trigger element is triggered repeatedly. The element concatenation identifier refers to the concatenation result of the trigger element identifier and the element address.
[0147] Exemplarily, for any trigger state element identifier, when there is a trigger state element identifier, the element address of the trigger state element identifier is obtained, the trigger state element identifier and the element address are spliced to obtain an element splicing identifier, and if the element splicing identifier meets the preset first trigger condition, the trigger state element identifier and the corresponding first interface are associated and stored in the element mapping interface set. The element mapping interface set may include mapping relationships between multiple trigger state element identifiers and their corresponding first interfaces.
[0148] In a feasible embodiment, step A20 also includes steps A24 to A25:
[0149] Step A24, when it is detected that the element is triggered for a preset time, the calling request of the trigger state element identifier of the element to the first interface is reset to the calling request of the page identifier of the page where the element is located to the second interface;
[0150] Step A25, when the page identifier satisfies a preset second trigger condition, intercepting a second interface of the page identifier;
[0151] The preset second trigger condition indicates that the page identifier is not triggered repeatedly.
[0152] It should be noted that if the duration of a trigger element being triggered exceeds a preset duration, the interface corresponding to the page where the trigger element is located may be intercepted, and the interface corresponding to the page identifier may be stored in association with the trigger element identifier. This will result in subsequent permission settings for the trigger element identifier. In addition to the interface corresponding to the trigger element identifier also being set for permissions, the interface corresponding to the page identifier where the trigger element identifier is located may also be set to the same permissions as the trigger element identifier. Different trigger element identifiers in the same front-end page have different permissions that need to be set, and the permissions corresponding to the page identifier may also be different from the permissions that need to be set for the trigger element identifier. Therefore, the front-end page corresponding to the page identifier may not be accessed normally, or other trigger element identifiers in the front-end page may not be accessed normally.
[0153] Therefore, in this embodiment, when the trigger state element is triggered for a preset time, the call request of the trigger state element identifier to the first interface is reset to the call request of the page identifier where the trigger state element identifier is located to the second interface. Avoid associating the interface corresponding to the page identifier with the trigger state element identifier. This is to avoid subsequent permission access exceptions. The preset time can be determined based on actual conditions.
[0154] The preset second trigger condition includes that the page identifier does not exist in the corresponding front-end mapping interface set, or the page identifier does not exist in the storage module for storing the front-end mapping interface set in the software system. In order to avoid the second interface corresponding to the page identifier being frequently intercepted, it can be determined whether the page identifier meets the preset second preset trigger condition before intercepting the second interface, so as to intercept the second interface of the page identifier when the page identifier is not repeatedly triggered. Thereby, the problem of software system operation overload caused by frequent interception can be avoided.
[0155] Exemplarily, when a trigger state element is detected to be triggered, the duration of the trigger state element being triggered is timed, and when the duration of the trigger state element being triggered reaches a preset duration, the call request of the trigger state element identifier to the first interface is reset to the call request of the page identifier of the page where the trigger state element is located to the second interface, and when the page identifier meets the preset second trigger condition, the second interface of the page identifier is intercepted. If the page identifier does not meet the preset second trigger condition, the second interface of the page identifier is not intercepted.
[0156] To better understand this embodiment, a brief code for intercepting the first interface is given below, and related explanations are given:
[0157] / / Record the open method of the xhr interface object;
[0158] const _open = XMLHttpRequest.prototype.open;
[0159] / / Rewrite the open method of the xhr interface object to intercept xhr requests;
[0160] XMLHttpRequest.prototype.open = function (method, url, bool, other) {
[0161] const targetId = getTargetId(location.href);
[0162] const requestUrl = deal(url);
[0163] const cacheKey = targetId + ":" + requestUrl;
[0164] const cachedData = JSON.parse(sessionStorage.getItem('__page_url_collect') || '[]');
[0165] if (requestUrl&&!cachedData.includes(cacheKey)) {
[0166] cachedData.push(cacheKey);
[0167] sessionStorage.setItem('__page_url_collect', JSON.stringify(cachedData));
[0168] / / Save the intercepted interface when cacheKey is not stored repeatedly; fetch(`${baseUrl}?eventType=${Handler.eventType}&targetId=${targetId}&url=${requestUrl}`);}
[0169] debouncedChangeEventType();
[0170] / / Call XHR capabilities;
[0171] return _open.call(this, method, url, bool, other)}
[0172] Among them, const _open = XMLHttpRequest.prototype.open means recording the open method of the xhr (XMLHttpRequest) interface object, that is, recording the opening method of the interface; "XMLHttpRequest.prototype.open = function (method, url, bool, other){consttargetId = getTargetId(location.href);const requestUrl = deal(url);" means rewriting the open method of the xhr interface object to intercept the xhr interface request; "const cacheKey = targetId + ":"+ requestUrl;" means splicing the contact state element identifier and element address.
[0173] “constcachedData=JSON.parse(sessionStorage.getItem('__page_url_collect') || '[]'); if (requestUrl&&!cachedData.includes(cacheKey)){cachedData.push(cacheKey);sessionStorage.setItem('__page_url_collect',JSON.stringify(cachedData));fetch(`${baseUrl}?eventType=${Handler.eventType}&targetId=${targetId}&url=${requestUrl}`);}” means saving the intercepted interface when it is determined that cacheKey is not stored repeatedly. Among them, "const cachedData=JSON.parse(sessionStorage.getItem('_page_url_collect') || '[]');if (requestUrl&&!cachedData.includes(cacheKey))" is used to determine whether cacheKey has been stored repeatedly, and cacheKey is equivalent to the element splicing identifier in this embodiment; if cacheKey has not been stored repeatedly, it means that the targetId corresponding to cacheKey has not been repeatedly triggered, and targetId is equivalent to the trigger state element identifier in this embodiment, then the if statement is executed to save the intercepted first interface.
[0174] "debouncedChangeEventType();" indicates that the anti-shake function is executed to reduce the processing frequency of the software system processing click events. "return _open.call(this, method, url, bool, other)" indicates that the XHR capability is called to initialize the xhr interface request.
[0175] Step A30: associate the trigger state element identifier with the first interface to determine the element mapping interface set, and associate the page identifier with the second interface to determine the page mapping interface set.
[0176] It should be noted that each page has its own corresponding unique page identifier, and the trigger state element identifiers of each trigger state element in the same page are unique. In this embodiment, the first interface corresponding to each trigger state element identifier in the software system can be obtained, and the trigger state element identifier can be associated with the corresponding first interface to determine the mapping interface set. In this embodiment, the second interface corresponding to each page identifier in the software system can also be obtained. Thereby, the mapping relationship between the front-end identifier and the interface module can be determined, so as to facilitate the subsequent permission configuration of the modules of the software system through the front-end identifier. In the test environment, each element displayed on the front end will be triggered, and each element will be triggered, so that the mapping relationship between the trigger state element and the first interface can be fully scanned.
[0177] Exemplarily, for any triggered trigger state element identifier, if the trigger state element identifier is not repeatedly triggered, the trigger state element identifier and the first interface are associated and stored in the element mapping interface set; for any page identifier, if the page identifier is not repeatedly triggered, the page identifier and the second interface are associated and stored in the page mapping interface set.
[0178] In one embodiment, after step A30, steps B10 to B20 are also included:
[0179] Step B10, receiving a calibration request for a target calibration interface in the front-end mapping interface set, and determining calibration indication information from the calibration request;
[0180] Step B20: calibrate the target calibration interface according to the calibration instruction information.
[0181] It should be noted that after obtaining the front-end mapping interface set, the front-end mapping interface set can be pushed to the administrator of the software system so that the administrator can check the mapping relationship between the front-end identifier in the front-end mapping interface set and each interface module to avoid abnormal mapping relationship.
[0182] The target calibration interface is the interface that needs to be calibrated in the front-end mapping interface set, and the calibration request is used to instruct the calibration of the target calibration interface. The calibration instruction information is characterized as the instruction information for calibrating the target calibration interface. The calibration instruction information can be the deletion of the target calibration interface and the mapping relationship between the target calibration interface and the front-end identifier; it can also be the modification of the target calibration interface to ensure the accuracy of each target calibration interface in the front-end mapping interface set.
[0183] Exemplarily, the interface determines the calibration instruction information from the calibration request for the target calibration interface in the front-end mapping interface set. If the calibration instruction information includes modifying the target calibration interface, the target calibration interface is modified based on the calibration instruction information; if the calibration instruction information includes deleting the target calibration interface and its corresponding mapping relationship with the front-end identifier, the target calibration interface and its corresponding mapping relationship with the front-end identifier are deleted based on the calibration instruction information. This ensures the accuracy of the front-end mapping interface set, and facilitates the subsequent accurate permission configuration of the front-end identifier and the interface module. In other embodiments, query operations on the front-end mapping interface set can also be supported.
[0184] In a feasible embodiment, the method further includes steps C10 to C30:
[0185] Step C10, when the front end of the software system detects a newly added front end identifier, obtain the newly added interface information requested to be called by the newly added front end identifier;
[0186] Step C20, associating the newly added front-end identifier and the newly added interface information and storing them in a temporary interface mapping set;
[0187] Step C30: upon receiving a confirmation indication of adding a new temporary interface mapping set, storing the temporary interface mapping set into the front-end mapping interface set.
[0188] It should be noted that the newly added front-end identifier is the newly added front-end identifier monitored on the software system. The newly added front-end identifier includes the newly added page identifier and / or the newly added trigger element identifier. The temporary interface mapping interface set is used to store the newly added front-end identifier and the newly added interface information. Before a new function is launched on the software system, the software system generally needs to be tested, so the software system may re-enter the test environment at different times. Therefore, after determining the front-end mapping interface set, if the software system subsequently enters the test environment again, it is possible to monitor whether the software system has a newly added front-end identifier in order to update the front-end mapping interface set and ensure the integrity of the front-end mapping interface set.
[0189] The confirmation of the new addition instruction is used to instruct the temporary interface mapping set to be stored in the front-end mapping interface set. The new addition instruction can be initiated by relevant management personnel of the software system, such as the operation and maintenance personnel or product manager of the software system, that is, personnel who do not understand the technical details of the back-end interface of the software system can also instruct to update the front-end mapping interface set.
[0190] Exemplarily, when it is detected that a new trigger state element identifier is triggered in the software system, the new first interface called by the new trigger state element identifier is intercepted, and when the new trigger state element identifier is triggered for a preset time, the call request of the new trigger state element identifier to the new first interface is reset to the call request of the page identifier of the element page to which the new trigger state element identifier belongs to the second interface, and it is determined whether the element page is a new page. If the element page is a new page, the second interface of the new page identifier of the new page is intercepted; if the element page is not a new page, the second interface of the element page is not intercepted. The new trigger state element identifier is associated with the corresponding new first interface and stored in the temporary interface mapping set; if there is a new page, the new page identifier of the new page and the corresponding second interface are associated and stored in the temporary interface mapping set.
[0191] When a confirmation indication of a new addition to the temporary interface mapping set is received, the temporary interface mapping set is stored in the front-end mapping interface set. Specifically, if the temporary interface mapping set includes a newly added trigger state element identifier, the newly added trigger state element identifier is associated with the corresponding newly added first interface and stored in the element mapping interface set; if the temporary interface mapping set includes a newly added page identifier, the newly added page identifier and the corresponding second interface are associated and stored in the page mapping interface set. This ensures the integrity of the front-end mapping interface set.
[0192] Among them, monitor whether there is a triggered element in the front end of the software system, and judge whether the element is a new element based on the trigger state element identifier and the obtained element address. If the concatenated identifier of the trigger state element identifier and the element address is not found in the front-end mapping interface set, it is determined that a new identification element has been triggered in the software system. If the concatenated identifier of the trigger state element identifier and the element address is found in the front-end mapping interface set, it is determined that no new identification element has been triggered in the software system.
[0193] If the element page identifier is found in the front-end mapping interface set, it is determined that the element page is not a newly added page; if the element page identifier is not found in the front-end mapping interface set, it is determined that the element page is a newly added page.
[0194] Further, see Figure 3 The method further includes steps D10 to D20:
[0195] Step D10, periodically scanning the backend interface list of the software system;
[0196] Step D20, determining a target deletion interface different from the backend interface list from the frontend mapping interface set, and deleting the target deletion interface to update the frontend mapping interface set.
[0197] It should be noted that the backend interface list is a collection of all backend interfaces in the software system. The target deletion interface is represented by the interface that needs to be deleted in the front-end mapping interface set. During the operation of the software system, some interfaces of the backend of the software system may be deleted due to user needs, while the interfaces of this part are still saved in the front-end mapping interface set. In order to avoid subsequent permission configuration anomalies, it is necessary to calibrate the front-end mapping interface set and delete the interfaces that are in the front-end mapping set but not in the back-end interface list to ensure the accuracy of the front-end mapping interface set.
[0198] Exemplarily, the backend interface list of the software system can be periodically scanned according to a preset period. The preset period can be determined based on actual conditions, and this embodiment does not impose specific restrictions on this. Compare each interface in the front-end mapping interface set with each interface in the back-end interface list, delete all target deletion interfaces in the front-end mapping interface set that are different from the back-end interface list, and delete the mapping relationship corresponding to the target deletion interface to update the front-end mapping interface set. Thereby, the accuracy of the front-end mapping interface set can be guaranteed. Exemplarily, the script of the NodeJS timing service can be determined to periodically scan the back-end interface list of the software system. There is no need for manual detection and comparison of whether there is a new front-end identifier, which improves efficiency and ensures the accuracy of the front-end mapping interface set.
[0199] It should be noted that the above specific embodiments are only used to understand the present invention and do not constitute a limitation on the interface permission configuration method of the present invention. More simple transformations based on this technical concept are all within the protection scope of the present invention.
[0200] The embodiment of the present invention also provides an interface authority configuration device, please refer to Figure 4 , the interface authority configuration device includes:
[0201] A display module 10 is used to visually display each front-end identifier in the front-end mapping interface set in the software system;
[0202] A receiving module 20, configured to receive an external permission configuration request input based on each of the front-end identifiers of the visual display;
[0203] A determination module 30, configured to determine a target front-end identifier specified by the permission configuration request and a target interface module in the front-end mapping interface set that has a mapping relationship with the target front-end identifier;
[0204] The configuration module 40 is used to configure the access rights of the target front-end identifier according to the permission configuration request, so as to synchronously configure the access rights of the target interface module.
[0205] The interface permission configuration device provided by the present invention adopts the interface permission configuration method in the above embodiment, which can solve the technical problem of low efficiency of interface permission configuration of the software system. Compared with the prior art, the beneficial effects of the interface permission configuration device provided by the embodiment of the present invention are the same as the beneficial effects of the interface permission configuration method provided by the above embodiment, and other technical features in the interface permission configuration device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0206] An embodiment of the present invention provides an electronic device, including a memory, a processor, and an interface permission configuration program stored in the memory and executable on the processor. When the interface permission configuration program is executed by the processor, at least one processor can execute the interface permission configuration method in the above embodiment.
[0207] Reference below Figure 5 , which shows a schematic structural diagram of an electronic device suitable for implementing an embodiment of the present disclosure. Figure 5 The structure of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0208] like Figure 5 As shown, the electronic device may include a processor 101, such as a CPU, a communication bus 102, a user interface 103, a network interface 104, and a memory 105. Among them, the communication bus 102 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 103 may also include a standard wired interface and a wireless interface. The network interface 104 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 105 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 105 may also be a storage device independent of the aforementioned processor 101.
[0209] Those skilled in the art will understand that Figure 5 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0210] like Figure 5As shown, the memory 105 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an interface authority configuration program.
[0211] exist Figure 5 In the electronic device shown, the network interface 104 is mainly used to connect to the background server and communicate data with the background server; the user interface 103 is mainly used to connect to the client and communicate data with the client; and the processor 101 can be used to call the interface permission configuration program stored in the memory 105 to execute the steps of the interface permission configuration method.
[0212] The electronic device provided by the present invention adopts the interface permission configuration method in the above embodiment to solve the technical problem of low efficiency of interface permission configuration of the software system. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present invention are the same as the beneficial effects of the interface permission configuration method provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0213] It should be understood that the various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0214] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0215] An embodiment of the present invention provides a computer-readable storage medium, including computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the interface permission configuration method in the above-mentioned embodiment 1.
[0216] The computer-readable storage medium provided in the embodiment of the present invention may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection including one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0217] The computer-readable storage medium may be included in the interface authority configuration device; or may exist independently without being assembled into the interface authority configuration device.
[0218] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the interface permission configuration device, the interface permission configuration device: visualizes the front-end identifiers in the front-end mapping interface set in the software system; receives a permission configuration request input from the outside based on each of the front-end identifiers displayed visually; determines the target front-end identifier specified by the permission configuration request, and the target interface module that has a mapping relationship with the target front-end identifier in the front-end mapping interface set; configures the access rights of the target front-end identifier according to the permission configuration request, so as to synchronously configure the access rights of the target interface module.
[0219] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0220] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0221] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0222] The readable storage medium provided by the present invention is a computer-readable storage medium, which stores computer-readable program instructions for executing the above-mentioned interface permission configuration method, and can solve the technical problem of low efficiency of interface permission configuration of the software system. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the embodiment of the present invention are the same as the beneficial effects of the interface permission configuration method provided in the above-mentioned embodiment, and will not be repeated here.
[0223] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the above-mentioned interface permission configuration method when executed by a processor.
[0224] The computer program product provided by the present invention can solve the technical problem of low efficiency of interface permission configuration of software system. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as the beneficial effects of the interface permission configuration method provided by the above embodiment, which will not be repeated here.
[0225] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent scope of the present invention.
Claims
1. An interface authority configuration method, characterized in that: The interface authority configuration method comprises: Visually display each front-end identifier in the front-end mapping interface set in the software system; Receiving an external permission configuration request input based on each of the front-end identifiers of the visual display; Determine the target front-end identifier specified by the permission configuration request, and the target interface module in the front-end mapping interface set that has a mapping relationship with the target front-end identifier; According to the permission configuration request, configure the access rights of the target front-end identifier to synchronously configure the access rights of the target interface module; The front-end mapping interface set includes a page mapping interface set and an element mapping interface set, the front-end identifier includes a page identifier and a trigger state element identifier, and the interface module includes a first interface and a second interface; Before the step of each front-end identifier in the front-end mapping interface set in the visual display software system, the step further includes: When the software system is in a test environment, monitoring the front end of the software system; In the case where there is a trigger state element whose running state is triggered in the front end, obtaining the trigger state element identifier of the trigger state element, intercepting the first interface pre-requesting the call of the trigger state element identifier, and intercepting the second interface pre-requesting the call of the page identifier of the page where the trigger state element is located; The trigger state element identifier is associated with the first interface to determine an element mapping interface set, and the page identifier is associated with the second interface to determine a page mapping interface set.
2. The method according to claim 1, characterized in that In the case where there is a triggered state element whose running state is triggered in the front end, the step of obtaining the triggered state element identifier of the triggered state element includes: In the case that there is a triggered web page event on the front end, intercepting the web page event, and determining the trigger state element identifier of the triggered trigger state element from the web page event; The web page event includes a first event marked by a first element created by initialization, and / or a second event marked by a second element created by non-initialization.
3. The method according to claim 1, characterized in that The step of intercepting the first interface called by the trigger state element identification pre-request comprises: Obtaining the element address of the trigger state element identifier; Concatenate the trigger state element identifier and the element address to obtain an element concatenation identifier; When the element splicing identifier satisfies a preset first trigger condition, intercepting a first interface called by the element identifier request; The preset first trigger condition indicates that the trigger state element corresponding to the element splicing identifier is not repeatedly triggered.
4. The method according to claim 1, characterized in that The step of intercepting the second interface called by the page identifier pre-request of the page where the trigger state element is located comprises: When it is detected that the trigger state element is triggered for a preset time, the call request of the trigger state element identifier of the trigger state element to the first interface is reset to the call request of the page identifier of the page where the trigger state element is located to the second interface; When the page identifier satisfies a preset second trigger condition, intercepting a second interface of the page identifier; The preset second trigger condition indicates that the page identifier is not triggered repeatedly.
5. The method according to claim 1, characterized in that After the steps of associating the trigger state element identifier with the first interface to determine the element mapping interface set, and associating the page identifier with the second interface to determine the page mapping interface set, the method further includes: receiving a calibration request for a target calibration interface in the front-end mapping interface set, and determining calibration indication information from the calibration request; The target calibration interface is calibrated according to the calibration instruction information.
6. The method according to claim 1, characterized in that The method includes: When the front end of the software system detects a newly added front end identifier, obtaining a newly added interface called by the newly added front end identifier request; The newly added front-end identifier and the newly added interface are associated and stored in a temporary interface mapping set; When a confirmation and addition indication of the temporary interface mapping set is received, the temporary interface mapping set is stored in the front-end mapping interface set.
7. The method according to any one of claims 1 to 6, characterized in that: The method includes: Periodically scan the backend interface list of the software system; A target deletion interface different from the backend interface list is determined from the frontend mapping interface set, and the target deletion interface is deleted to update the frontend mapping interface set.
8. An interface authority configuration device, characterized in that: The device comprises: A display module, used for visually displaying each front-end identifier in a front-end mapping interface set in a software system; the front-end mapping interface set includes a page mapping interface set and an element mapping interface set, the front-end identifier includes a page identifier and a trigger state element identifier, and the interface module includes a first interface and a second interface; A receiving module, used for receiving an external permission configuration request input based on each of the front-end identifiers of the visual display; A determination module, used to determine the target front-end identifier specified by the permission configuration request, and a target interface module in the front-end mapping interface set that has a mapping relationship with the target front-end identifier; A configuration module, configured to configure the access rights of the target front-end identifier according to the permission configuration request, so as to synchronously configure the access rights of the target interface module; The display module is also used to monitor the front end of the software system when the software system is in a test environment; The display module is also used to obtain the trigger state element identifier of the trigger state element, intercept the first interface of the trigger state element identifier pre-request call, and intercept the second interface of the page identifier pre-request call of the page where the trigger state element is located when there is a trigger state element whose running state is triggered in the front end; The display module is further used to associate the trigger state element identifier with the first interface to determine an element mapping interface set, and to associate the page identifier with the second interface to determine a page mapping interface set.
9. An electronic device, characterized in that: The method comprises a memory, a processor, and an interface permission configuration program stored in the memory and executable on the processor. When the interface permission configuration program is executed by the processor, the steps of the interface permission configuration program according to any one of claims 1 to 7 are executed.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium storing an interface permission configuration program executable on a processor, wherein the interface permission configuration program is invoked by the processor to implement the steps of the interface permission configuration program described in any one of claims 1 to 7.
Citation Information
Patent Citations
A configurable interface access control method
CN109165486A
Authority visual configuration control method and device in an information system, terminal and storage medium
CN110443010A
Permission configuration interface display method and device, terminal and storage medium
CN110457891A
Page access permission control method
CN111552987A
Interface permission configuration method and system for vehicle-mounted application program, and storage medium
CN112052030A
