Page updating method and device, computer equipment, readable storage medium and program product
By displaying the permission control component on the page and responding to user operations, and dynamically managing permissions with preset permission instructions, the problem of poor permission control flexibility in traditional technology is solved, and more fine-grained permission control and data security are achieved.
Patent Information
- Application Number
- CN202411998952.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-15
AI Technical Summary
In traditional technology, the code reusability of permission control is low, resulting in poor flexibility in permission control, making it difficult to achieve effective management when the same component needs permission control based on different conditions.
By displaying the permission control component on the page, responding to user operations to determine the operation results of responsive data, and dynamically managing the permission scope of the permission control component through preset permission instructions, realizing dynamic updates and permission management of the component.
It improves the flexibility of permission control, realizes finer granular permission control, reduces code redundancy, simplifies the management and maintenance of permission logic, and ensures data security.
Smart Images

Figure CN119829862A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a page updating method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of Internet technology, the permission control of system front-end components in business management has become a demand. In traditional technology, there are two main types of component control. One is to independently control the permission status of each component by calling the permission control code one by one. The second is to add permission instructions to the components that need to be controlled through custom permission instructions to control the permission status of the components. The former requires that the permission control code be called separately for each component that needs permission control, resulting in code redundancy, large development and maintenance workload, and difficulty in unified management and centralized modification of permission logic. Compared with the former one-by-one calling method, the latter solution reduces redundant code and facilitates unified management and maintenance. However, when the same component needs to be controlled based on different conditions, it is still necessary to fall back to the former solution, resulting in insufficient flexibility.
[0003] Therefore, solutions in traditional technologies all have the problem of low code reusability for permission control, resulting in poor flexibility of permission control. Summary of the invention
[0004] Based on this, it is necessary to provide a page update method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the flexibility of permission control in response to the above technical problems.
[0005] In a first aspect, the present application provides a page updating method, comprising:
[0006] Display the permission control component on the first page;
[0007] In response to a triggering operation on the permission control component, determining first responsive data controlled by the permission control component, and determining second responsive data bound to a preset permission instruction in the permission control component;
[0008] In the case where the first responsive data and the second responsive data are bound, determining a first operation result of the trigger operation on the second responsive data,
[0009] and, determining a second operation result of the trigger operation on the first responsive data through the preset permission instruction bound to the second responsive data;
[0010] According to the first operation result and the second operation result, the page element to be re-rendered controlled by the permission control component is determined, and re-rendered to obtain a second page.
[0011] In one embodiment, the preset permission instruction includes an insert instruction; before displaying the permission control component on the first page, the method further includes:
[0012] Determine the second responsive data and the insert instruction in the preset permission instruction bound to the second responsive data;
[0013] Determine the relationship between the second responsive data and the first responsive data to obtain a determination result;
[0014] According to the insertion instruction and the judgment result, a permission control component to be inserted into the first page is determined.
[0015] In one embodiment, determining the permission control component to be inserted into the first page according to the insertion instruction and the judgment result includes:
[0016] If the judgment result indicates that the second responsive data and the first responsive data are bound to each other, the page permission corresponding to the first page is determined according to the second responsive data, and the role permission corresponding to the first page is determined according to the first responsive data;
[0017] The permission control component corresponding to the page permission and the role permission is determined, and the permission control component is inserted into the first page through an insert instruction.
[0018] In one embodiment, determining the permission control component to be inserted into the first page according to the insertion instruction and the judgment result further includes:
[0019] If the judgment result indicates that there is no binding relationship between the second responsive data and the first responsive data, determining the page permission corresponding to the first page according to the second responsive data;
[0020] The permission control component corresponding to the page permission is determined, and the permission control component is inserted into the first page through an insert instruction.
[0021] In one embodiment, the method further comprises:
[0022] In a case where the first responsive data and the second responsive data are not bound, determining a first operation result of the trigger operation on the second responsive data;
[0023] According to the first operation result, the page element to be re-rendered controlled by the permission control component is determined, and re-rendered to obtain a second page.
[0024] In one embodiment, the preset permission instruction includes an update instruction; and determining the second operation result of the trigger operation on the first responsive data through the preset permission instruction bound to the second responsive data includes:
[0025] Obtaining a corresponding updated value of the first responsive data through the update instruction bound to the second responsive data;
[0026] The updated value is compared with a preset value for the first response data to obtain a second operation result of the trigger operation on the first response data.
[0027] In a second aspect, the present application further provides a page updating device, comprising:
[0028] The permission control component display module is used to display the permission control component on the first page;
[0029] A responsive data determination module, configured to determine, in response to a triggering operation on the permission control component, first responsive data controlled by the permission control component and second responsive data bound to a preset permission instruction in the permission control component;
[0030] an operation result determination module, which determines, when the first responsive data and the second responsive data are bound, a first operation result of the trigger operation on the second responsive data, and determines, through the preset permission instruction bound to the second responsive data, a second operation result of the trigger operation on the first responsive data;
[0031] The page rendering module determines the page elements to be re-rendered controlled by the permission control component according to the first operation result and the second operation result, and re-renders to obtain a second page.
[0032] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Display the permission control component on the first page;
[0034] In response to a triggering operation on the permission control component, determining first responsive data controlled by the permission control component, and determining second responsive data bound to a preset permission instruction in the permission control component;
[0035] In the case where the first responsive data and the second responsive data are bound, determining a first operation result of the trigger operation on the second responsive data,
[0036] and, determining a second operation result of the trigger operation on the first responsive data through the preset permission instruction bound to the second responsive data;
[0037] According to the first operation result and the second operation result, the page element to be re-rendered controlled by the permission control component is determined, and re-rendered to obtain a second page.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0039] Display the permission control component on the first page;
[0040] In response to a triggering operation on the permission control component, determining first responsive data controlled by the permission control component, and determining second responsive data bound to a preset permission instruction in the permission control component;
[0041] In the case where the first responsive data and the second responsive data are bound, determining a first operation result of the trigger operation on the second responsive data,
[0042] and, determining a second operation result of the trigger operation on the first responsive data through the preset permission instruction bound to the second responsive data;
[0043] According to the first operation result and the second operation result, the page element to be re-rendered controlled by the permission control component is determined, and re-rendered to obtain a second page.
[0044] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0045] Display the permission control component on the first page;
[0046] In response to a triggering operation on the permission control component, determining first responsive data controlled by the permission control component, and determining second responsive data bound to a preset permission instruction in the permission control component;
[0047] In the case where the first responsive data and the second responsive data are bound, determining a first operation result of the trigger operation on the second responsive data,
[0048] and, determining a second operation result of the trigger operation on the first responsive data through the preset permission instruction bound to the second responsive data;
[0049] According to the first operation result and the second operation result, the page element to be re-rendered controlled by the permission control component is determined, and re-rendered to obtain a second page.
[0050] The above-mentioned page update method, apparatus, computer equipment, computer-readable storage medium and computer program product display a permission control component in a first page; in response to a trigger operation on the permission control component, determine the first responsive data controlled by the permission control component, and determine the second responsive data bound to a preset permission instruction in the permission control component; when the first responsive data and the second responsive data are bound, determine the first operation result of the trigger operation on the second responsive data, and, through the preset permission instruction bound to the second responsive data, determine the second operation result of the trigger operation on the first responsive data; based on the first operation result and the second operation result, determine the page element to be re-rendered controlled by the permission control component, and re-render it to obtain a second page. In this application, when the user triggers the permission control component, the first responsive data is parsed and extracted in real time. Through the analysis of the first responsive data, the system can grasp the user role information in real time, providing a dynamic basis for the subsequent permission logic judgment. By extracting the second responsive data bound to the preset permission instruction, the dynamic management of the permission range of the permission control component is realized. After the responsive data binding relationship is established, the permission logic is used to make a basic judgment on whether the user has the component operation permission, so that the same element component under the same user role can be dynamically updated according to the bound responsive data. Custom instruction status can be dynamically updated to achieve the permission of the element component. Combined with the first operation result and the second operation result, the correct page rendering is completed while preventing data unauthorized access and data leakage, ensuring data security. It meets the current large-scale, highly complex, and highly customized systems, thereby achieving more fine-grained permission control and improving the flexibility of permission control. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 An application environment diagram of a page updating method in an embodiment;
[0053] Figure 2 A schematic diagram of a flow chart of a page updating method in one embodiment;
[0054] Figure 3 This is a schematic diagram of first responsive data in an embodiment;
[0055] Figure 4 A schematic diagram of second responsive data in one embodiment;
[0056] Figure 5 A system architecture diagram of a page update method in one embodiment;
[0057] Figure 6 A schematic diagram of setting a permission control component in one embodiment;
[0058] Figure 7 It is a structural block diagram of a page updating device in one embodiment;
[0059] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] The page update method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be integrated on the server, or it can be placed on the cloud or other network servers. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart TVs, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0062] In an exemplary embodiment, Figure 2 As shown, a page update method is provided, which is applied to Figure 1 The terminal in is taken as an example to illustrate, including the following steps S202 to S208. Among them:
[0063] Step S202: displaying the permission control component on the first page.
[0064] The first page refers to the rendered web interface, which is used to display the permission control component. The permission control component is used to manage the permissions of page elements. Its main function is to dynamically adjust the display status or operable status of the component according to the user's role permissions and page permission configuration. The permission control component is linked with responsive data by binding preset permission instructions to ensure that the operations on the page are limited to the authorized scope.
[0065] Step S204, in response to the triggering operation on the permission control component, determining the first responsive data controlled by the permission control component, and determining the second responsive data bound to the preset permission instruction in the permission control component.
[0066] Among them, the first responsive data is the variable related to the dynamic state of the page or user operation, which is used to control the component permission behavior, such as Figure 3 As shown, in the front-end responsive data management system of the terminal, such as the current user's role identifier roleId or the operating environment identifier env. These data reflect the changes in user operations or page status and are the basis for subsequent permission verification. The second responsive data is the data variable bound to the permission control component, which defines the permission scope of the component and the association relationship with other dynamic data (such as the first responsive data), such as Figure 4 As shown, the second responsive data is registered in the front-end permission management system of the terminal, such as create, delete, etc. in the permission identifier Actionlist. The preset permission instruction is the core logic of permission management. It is bound to the second responsive data of the permission control component by the terminal to implement permission checking and dynamic state management, including a series of instruction hook functions (such as insert, update), which trigger permission verification when the page is loaded or the data is updated, and operate the component state.
[0067] Exemplarily, a user triggers an operation event of a permission control component (such as clicking a button or modifying an option). First, the terminal determines the first responsive data registered in the front-end responsive data management system in the triggered permission control component, and extracts the second responsive data bound to the preset permission instruction. At the same time, the terminal verifies the association between the first responsive data and the second responsive data in combination with the preset permission instruction.
[0068] Step S206, when the first responsive data and the second responsive data are bound, determine the first operation result of the trigger operation on the second responsive data, and, through the preset permission instruction bound to the second responsive data, determine the second operation result of the trigger operation on the first responsive data.
[0069] The first operation result is the permission judgment result obtained after executing the permission instruction logic on the second responsive data. The second operation result is the dynamic judgment result obtained by linking the permission instruction bound to the second responsive data with the first responsive data.
[0070] The terminal first confirms that the binding relationship between the first responsive data (such as roleId) and the second responsive data (such as createUser) has taken effect. The binding relationship is implemented through permission instructions. When the binding relationship is confirmed, the change of the first responsive data can dynamically affect the permissions of the corresponding component of the second responsive data. After the binding relationship is confirmed, the user triggers the operation event of the permission control component (such as clicking a button). The terminal performs permission verification on the second responsive data bound to the component through the permission instruction logic to determine whether the current user role meets the permission requirements. After the permission verification is completed, the terminal generates a first operation result, indicating whether the component meets the basic permission requirements. At the same time, the terminal continues to execute the permission instruction logic, and verifies whether the value of the first responsive data meets the dynamic permission requirements through the binding relationship of the second responsive data. For example, when the value of roleId is updated to admin, the permission instruction checks whether the role can operate the current page component and generates a second operation result.
[0071] Step S208: Determine the page element to be re-rendered controlled by the permission control component according to the first operation result and the second operation result, and re-render it to obtain a second page.
[0072] Page elements to be re-rendered refer to page components that need to adjust their status after a permission change is triggered by a user operation or data update. These page components may include displayed content, enabled status, or interactive functions, which need to be adjusted through re-rendering. Re-rendering refers to the process of regenerating or updating the display status, interactive logic, etc. of specific components on the page based on the permission judgment results. The re-rendering operation ensures that the page status is consistent with the permission verification results, and can be automatically completed through DOM operations or responsive frameworks.
[0073] The terminal first parses the result of the first operation through the logic of the preset permission instruction. The result of the first operation indicates whether the current user operation meets the permission requirements of the second responsive data. If the result is "allowed", the component remains displayed within the basic permission range; if the result is "not allowed", the component needs to be removed or disabled. Then, the terminal parses the result of the second operation. The second operation result is linked to the dynamic value of the first responsive data to determine the state of the page elements that need to be updated. For example, the update of roleId may affect whether certain buttons are displayed or not. The terminal will generate a list of components to be re-rendered based on the permission judgment rules. After determining the page elements to be re-rendered, the terminal executes the rendering logic. For components that meet the permission requirements, the terminal regenerates the DOM elements or enables the component interaction function; for components that do not meet the permission requirements, the terminal removes the corresponding DOM elements or disables their interaction functions. Finally, the page completes the status update, and the second page seen by the user is consistent with the current permission configuration.
[0074] The above method displays a permission control component in a first page; in response to a trigger operation on the permission control component, determines first responsive data controlled by the permission control component, and determines second responsive data bound to a preset permission instruction in the permission control component; when the first responsive data and the second responsive data are bound, determines a first operation result of the trigger operation on the second responsive data, and, through the preset permission instruction bound to the second responsive data, determines a second operation result of the trigger operation on the first responsive data; based on the first operation result and the second operation result, determines the page element to be re-rendered controlled by the permission control component, and re-renders it to obtain a second page. In this embodiment, when the user triggers the permission control component, the first responsive data is parsed and extracted in real time. By parsing the first responsive data, the system can grasp the user role information in real time, providing a dynamic basis for the subsequent permission logic judgment. By binding the preset permission instruction to extract the second responsive data, the dynamic management of the permission range of the permission control component is realized. After the data binding relationship is established, the permission logic is used to make a basic judgment on whether the user has the component operation permission, so that the same element component under the same user role can be dynamically updated according to the bound responsive data. Custom instruction status can be dynamically updated to achieve the permission of the element component. Combined with the first operation result and the second operation result, the correct page rendering is completed while preventing data unauthorized access and data leakage, ensuring data security. It meets the current large-scale, highly complex, and highly customized systems, thereby achieving more fine-grained permission control and improving the flexibility of permission control.
[0075] In an exemplary embodiment, the preset permission instruction includes an insert instruction; before displaying the permission control component in the first page, it also includes: determining the second responsive data and the insertion instruction in the preset permission instruction bound to the second responsive data; judging the relationship between the second responsive data and the first responsive data to obtain a judgment result; and determining the permission control component to be inserted into the first page based on the insertion instruction and the judgment result.
[0076] Among them, the insert instruction is a preset permission instruction, which is mainly used to determine the insertion status of the permission control component when the page is loaded. Through the insert instruction, the display of the component can be dynamically adjusted according to the permission judgment logic to ensure that the page only displays components that comply with the permission rules. The judgment result is the verification result of the association relationship between the second responsive data and the first responsive data. Through the judgment result, the system can determine whether the permission control component meets the current permission requirements and decide whether it can be inserted into the page.
[0077] Specifically, the terminal first loads the page structure, and at the same time calls the insertion instruction logic in the preset permission instruction to parse all components in the page that require permission control. For each permission control component, the terminal extracts the second responsive data bound to it and confirms its permission type and binding relationship. Then, the terminal judges the relationship between the second responsive data and the registered first responsive data. The judgment logic is determined by the permission instruction, including but not limited to the following operations, such as checking whether the second responsive data has established a binding relationship with the first responsive data and checking whether there is a valid permission value for the first responsive data. According to the judgment result, the terminal generates the insertion status of the permission component. If the judgment result is "binding is valid" and the permission meets the requirements, the terminal inserts the permission control component into the first page through the insertion instruction. If the judgment result is "binding is invalid" or the permission is insufficient, the terminal will not insert the component. Finally, the terminal completes the initialization of the permission component of the first page, and only displays the components that meet the permission requirements, and other components that do not meet the requirements are excluded or hidden.
[0078] In this embodiment, by combining the insertion of instructions and the judgment results to complete the initialization operation of the component before displaying the permission control component on the first page, the insertion of instructions can ensure that only components that comply with the permission rules are loaded when the page is initialized, reducing unnecessary permission checks, and excluding unauthorized components during the page initialization stage, thereby preventing potential risks of unauthorized access.
[0079] In an exemplary embodiment, the permission control component inserted into the first page is determined based on the insertion instruction and the judgment result, including: if the judgment result indicates that there is a binding relationship between the second responsive data and the first responsive data, then the page permissions corresponding to the first page are determined based on the second responsive data, and the role permissions corresponding to the first page are determined based on the first responsive data; the permission control components corresponding to the page permissions and the role permissions are determined, and the permission control components are inserted into the first page through the insertion instruction.
[0080] Among them, page permissions are defined by the second responsive data, which is used to describe the scope of permissions that can be operated on the current page. Page permissions are associated with specific operation functions (such as the permission of the "Create User" button is create), and are bound to page components through permission instructions. Role permissions are represented by the first responsive data (such as roleId), reflecting the role of the current user and its corresponding permission scope. For example, the admin role may have permissions for all pages and components, while the dev role may only have permissions for some operations. The binding relationship is a logical association between the first responsive data and the second responsive data, which is used to dynamically adjust the display status of the permission control component.
[0081] Specifically, the terminal calls the insert instruction when the page is loaded, and first parses the permission configuration of all permission control components. For each component, extract its bound second responsive data (such as create) and page permission identifier, and determine whether its binding relationship with the first responsive data (such as roleId) is valid. If the judgment result indicates that there is a binding relationship between the first responsive data and the second responsive data, the terminal further parses the permission configuration, and according to the second responsive data, the terminal obtains the operation scope of the current page from the page permission configuration. For example, create means that the current page supports the "create user" operation. According to the first responsive data value, the terminal obtains the user's permission scope from the role permission configuration. For example, roleId=admin means that the user admin has operation permissions. If both the page permissions and the role permissions meet the requirements, the component is inserted into the first page through the insert instruction.
[0082] In a specific embodiment, on the user management page, the first responsive data roleId indicates that the user role is dev, and the permission control component is bound to the second responsive data create identifier. It can be known that if the page permission is create, it means that the "create user" function is allowed to operate. The role permission is dev, which meets the page permission requirements. The terminal inserts the "create user" component into the page to complete the component initialization.
[0083] In this embodiment, by combining the insertion instruction and the judgment result, the permission control component in the page is dynamically determined. Through the dual judgment of page permissions and role permissions, only components that meet the permission requirements are loaded, reducing redundant operations during page initialization. The insertion of components is strictly constrained by page permissions and role permissions, preventing the incorrect display of unauthorized components and ensuring the security of the system.
[0084] In an exemplary embodiment, the permission control component inserted into the first page is determined based on the insertion instruction and the judgment result, and also includes: if the judgment result indicates that there is no binding relationship between the second responsive data and the first responsive data, the page permission corresponding to the first page is determined based on the second responsive data; the permission control component corresponding to the page permission is determined, and the permission control component is inserted into the first page through the insertion instruction.
[0085] Specifically, the terminal calls the insert instruction when the page is loaded to parse the permission configuration of all components that require permission management. For each component, the second responsive data bound to it is extracted to determine the page permissions of the component. The terminal detects that no binding relationship is established between the first responsive data and the second responsive data of the current component. At this time, the terminal independently determines the insertion status of the component based on the page permission logic of the second responsive data. Based on the second responsive data, the terminal obtains the permission range of the current component from the page permission configuration. The terminal verifies whether the current page has the specified page permissions. If the page permissions allow, the terminal inserts the component into the page through the insert instruction; otherwise, the terminal skips the component insertion to ensure that the page only displays content that complies with the page permissions.
[0086] In this embodiment, by combining the insertion instruction and the page permission judgment logic, the insertion status of the component is dynamically determined when the first responsive data and the second responsive data are not bound. Even if the first responsive data is not bound, the system can still independently judge the insertion status of the component through page permissions, thereby improving the flexibility of permission management.
[0087] In an exemplary embodiment, the method also includes: when the first responsive data and the second responsive data are not bound, determining a first operation result of the trigger operation on the second responsive data; based on the first operation result, determining the page element to be re-rendered controlled by the permission control component, and re-rendering to obtain a second page.
[0088] Specifically, the user triggers an operation event of the permission control component in the page (such as clicking a button or activating a function). When the first responsive data is not bound to the second responsive data, the terminal calls the update instruction of the preset permission instruction bound to the permission control component, verifies the second responsive data of the component (such as create or delete), and generates a first operation result. If the user operation complies with the page permission configuration, the first operation result is "allowed". If the user operation does not comply with the page permission configuration, the first operation result is "prohibited". The terminal parses the first operation result, and for components that are allowed by permission, the terminal adds them to the list of page elements to be re-rendered, and adjusts the display content according to the latest status (such as enabling button functions or updating display styles). For components that are prohibited by permission, the terminal removes them from the page or disables the operation function. The terminal dynamically adjusts the page elements according to the rendering task list, and the components that are allowed by permission will be re-rendered to ensure that the user can operate normally. Components that are prohibited by permission will be removed or displayed as disabled.
[0089] In this embodiment, by dynamically adjusting the state of the page element according to the first operation result when not bound, the first operation result provides a clear permission state for the page element, making permission management more precise and avoiding the risk of misoperation or unauthorized access. Through the re-rendering mechanism, users can immediately see the page state after the permission adjustment, which improves the smoothness and consistency of the interaction.
[0090] In an exemplary embodiment, the preset permission instruction includes an update instruction; the second operation result of the trigger operation on the first responsive data is determined through the preset permission instruction bound to the second responsive data, including: obtaining the corresponding update value of the first responsive data through the update instruction bound to the second responsive data; comparing the update value with the preset value of the first responsive data to obtain the second operation result of the trigger operation on the first responsive data.
[0091] The updated value refers to the new value generated by the first responsive data after a user operation or a change in the system status. For example, when the user role (roleId) is updated to admin, admin is the new updated value. The preset value is the standard value specified in the permission configuration, which is used to determine whether the first responsive data complies with the current permission rules. For example, the permission bound to the component stipulates that the value of the first responsive data is admin or ops.
[0092] Specifically, when a user triggers an operation of the permission control component (such as updating a role or changing a status), the terminal calls the update instruction bound to the second responsive data. The update instruction extracts the bound first responsive data and obtains its latest updated value. For example, the roleId bound to the permission control component is updated from user to admin. The terminal compares the updated value (such as admin) with the preset value (such as admin, ops) in the permission configuration. If the updated value matches the preset value, it means that the user's permission meets the requirements, and the second operation result is generated as "allowed". If the updated value does not match the preset value, the second operation result is generated as "prohibited". The terminal generates a second operation result based on the comparison result and determines the permission status of the bound component. If the second operation result is "allowed", the component status remains unchanged or a new function is enabled. If the second operation result is "prohibited", the component is disabled or removed.
[0093] In this embodiment, the update value of the first responsive data is dynamically detected through the update instruction and the permission check is performed. By comparing the updated value with the preset value, the system can adapt to dynamic permission requirements and meet complex permission management scenarios. By strictly checking the updated value, invalid data or unauthorized permission changes are prevented, thereby improving the security and reliability of the system.
[0094] In order to enable those skilled in the art to better understand the above steps, the embodiment of the present application is illustrated below by using an example, but it should be understood that the embodiment of the present application is not limited to this.
[0095] The method of the present application can be applied to Figure 5 In the terminal architecture shown in the figure, during the initialization phase, the user Figure 4 The registration and management of permissions are completed in the front-end permission management system shown in the figure. The routing meta field of each page contains a permission identifier, which is used to identify the scope of permissions that need to be controlled on the page. At the same time, the second responsive data actionList is used to mark the buttons or interactive elements that need permission management on the specific page. For example, the second responsive data of the "Create User" button is create, and the second responsive data of the "Delete User" button is delete. These permission data are managed uniformly for subsequent dynamic control. Figure 3 In the front-end responsive data management system shown in the figure, user registration requires the first responsive data (roleid, env) to be dynamically bound. For example, roleId is a dynamic data variable used to describe the user role, and its optional value is admin or ops, which is used to reflect the user's current role permissions. The responsive data establishes a dynamic binding relationship with the permission control component through the system, providing a basis for permission verification. Figure 6As shown, the front-end permission allocation system allocates permissions to different users. For example, the user whose value corresponding to the roleid in the first responsive data is dev is granted access to the "Business Management" page, and is allowed to operate component buttons such as "Create User", "Delete User" and "Use Password" on this page. At the same time, the display status of the "Use Password" component can be dynamically adjusted according to the value of roleId. The permission allocation data is loaded into the terminal after the user logs in, and is provided to the front-end VUE custom permission instruction control system. The front-end VUE custom permission instruction control system creates a preset permission instruction, and binds the preset permission instruction created with the second responsive data before parsing. In one embodiment, the front-end VUE custom permission instruction control system can obtain the first responsive data and the second responsive data bound to the permission control component through the preset permission instruction. Specifically, the front-end VUE custom permission instruction control system obtains the data structure [{"permission":"permissionId","actionList":[{"action":"createUser","describe":"Create user button","bind":"userRole","var":"admin#ops"}]}] through the preset permission instruction, wherein the permission field indicates which routing page access rights are owned; actionList indicates which registered front-end custom instruction-controlled element component permissions are owned under this page; action indicates the specific registered element component permissions; describe indicates the description of this registered component; if bind is not null, it means that the element permission can be controlled by the field of this value of the page, that is, the value of Roleid; var indicates that the permission is owned when the value of Roleid is admin or ops.
[0096] In an exemplary embodiment, when a user accesses a page, the front-end VUE custom permission instruction control system initializes the permission control component in the page by inserting instructions (inserted hooks). The terminal performs permission verification on the component that requires permission control based on the second responsive data and the routing identifier, combined with the binding relationship. For example, when loading the "User Management" page, the terminal extracts the second responsive data of the page's permission routing identifier and the component's actionList, and determines whether the user has permission to the page. If the page permissions contain the second responsive data, continue to verify the user's permissions.
[0097] For each component, the terminal checks whether its second responsive data (such as create) is bound to the first responsive data (such as roleId). If bound, the value of roleId is dynamically obtained through the permission instruction. For example, when the value of roleId is admin, the permission instruction determines that the user has the operation permission of the "Create User" button, and the button is inserted into the page; if the value of roleId does not meet the permission requirements, the component is removed or disabled to ensure that the permission range displayed on the user interface is accurate.
[0098] In a specific embodiment, in the inserted hook stage, the terminal executes the permission judgment logic when the page component is first loaded. First, the binding parameters (binding) of the hook function, the DOM element (el) of the current component, and the virtual node information (vnode) are obtained. Subsequently, the user role permission information and the permission identifier (permission) of the route where the current component is located are parsed to confirm whether the user has access rights to the route. If the user permissions do not include the route permissions, the current component is immediately deleted from the DOM tree to prevent the component from being accessed by unauthorized users.
[0099] If the user's permissions include the current routing permissions, the system further queries the list of all component permissions configured under the routing permissions to check whether the second responsive data of the current component is within the authorized scope. If the second responsive data is not authorized, the component is also deleted from the DOM tree. The second responsive data is authorized, and the system continues to check whether the binding relationship (expression) in the binding parameter exists. If not, it is skipped directly; if it exists, it determines whether the value of expression is consistent with the first responsive data bind value defined by the user. If not, the system will delete the component from the DOM tree; if consistent, it will continue to check whether the updated value (value) in the binding parameter meets the preset value (var) defined by the role permission. If the value does not meet the requirements, the system will delete the component and temporarily save its parent node and component information for subsequent recovery; if it meets the requirements, the component permission check passes and the page loading is completed.
[0100] In the update hook phase, when user operations or page data are updated, the system rechecks permissions and dynamically adjusts component status. First, the system obtains binding parameters, DOM elements, and virtual node information, and parses the current user role permissions and the permission identifier of the route where the component is located. If the user does not have the current route permission, the verification is skipped directly; if the user has the route permission, the system further checks whether the component permission list under the route permission contains the current component identifier.
[0101] For authorized components, the system checks whether the expression in the binding parameter exists. If it does not exist, it is skipped directly; if it exists, it is checked whether the expression value is consistent with the bind value defined in the role permission. If they are inconsistent, the subsequent operations are skipped; if they are consistent, it is checked whether the value of the binding parameter matches the var value of the component permission. If the value is consistent with the previous value, there is no need to update and it is skipped directly; if it is inconsistent, it is determined whether the new value matches the var value in the permission configuration. If they do not match, the system deletes the component in the DOM tree and temporarily saves the parent node and component information; if they match, the temporarily saved information is checked to determine whether the component has been deleted. If the component has been deleted, the component is restored from the temporarily saved information; if the component has not been deleted, the operation is skipped.
[0102] In this embodiment, when the user's authority changes, the terminal can automatically adjust the rendering and interaction status of the page components to ensure that the page is always consistent with the authority. Through accurate authority matching and efficient dynamic updates, the flexibility of authority management and user experience are effectively improved. Under the same user role, the same element component can be dynamically updated according to the bound responsive data. Customized instruction status can be dynamically updated to dynamically update the authority of the authority control component, achieving more fine-grained authority control, improving the development efficiency and operability of the system, completing the correct page rendering, and preventing data unauthorized access and data leakage, ensuring data security. It meets the current large-scale, highly complex, and highly customized systems.
[0103] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0104] Based on the same inventive concept, the embodiment of the present application also provides a page update device for implementing the page update method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the page update device provided below can refer to the limitations of the page update method above, and will not be repeated here.
[0105] In an exemplary embodiment, Figure 7 As shown, a page updating device is provided, including: an authority control component display module 710, a responsive data determination module 720, an operation result determination module 730 and a page rendering module 740, wherein:
[0106] The permission control component display module 710 is used to display the permission control component on the first page;
[0107] A responsive data determination module 720, configured to determine, in response to a triggering operation on the permission control component, first responsive data controlled by the permission control component and second responsive data bound to a preset permission instruction in the permission control component;
[0108] The operation result determination module 730 determines, when the first responsive data and the second responsive data are bound, a first operation result of the trigger operation on the second responsive data, and determines, through the preset permission instruction bound to the second responsive data, a second operation result of the trigger operation on the first responsive data;
[0109] The page rendering module 740 determines the page elements to be re-rendered that are controlled by the permission control component according to the first operation result and the second operation result, and re-renders to obtain a second page.
[0110] In an exemplary embodiment, the permission control component display module 710 is also used to determine the second responsive data and the insertion instruction in the preset permission instruction bound to the second responsive data; judge the relationship between the second responsive data and the first responsive data to obtain a judgment result; and determine the permission control component inserted into the first page based on the insertion instruction and the judgment result.
[0111] In an exemplary embodiment, the permission control component display module 710 is also used to determine the page permissions corresponding to the first page according to the second responsive data, and determine the role permissions corresponding to the first page according to the first responsive data if the judgment result indicates that the second responsive data and the first responsive data are bound to each other; determine the permission control components corresponding to the page permissions and the role permissions, and insert the permission control components into the first page through an insert instruction.
[0112] In an exemplary embodiment, the permission control component display module 710 is also used to determine the page permission corresponding to the first page according to the second responsive data if the judgment result indicates that there is no binding relationship between the second responsive data and the first responsive data; determine the permission control component corresponding to the page permission, and insert the permission control component into the first page through an insert instruction.
[0113] In an exemplary embodiment, the page rendering module 740 is also used to determine a first operation result of the trigger operation on the second responsive data when the first responsive data and the second responsive data are not bound; based on the first operation result, determine the page element to be re-rendered controlled by the permission control component, and re-render it to obtain a second page.
[0114] In an exemplary embodiment, the operation result determination module 730 is also used to obtain the corresponding update value of the first responsive data through the update instruction bound to the second responsive data; compare the update value with the preset value of the first responsive data to obtain the second operation result of the trigger operation on the first responsive data.
[0115] Each module in the above page update device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0116] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store routing permission information and the corresponding permissions of each permission control component. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor
[0117] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0119] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0120] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0122] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0123] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0124] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A page updating method, characterized in that: The method comprises: Display the permission control component on the first page; In response to a triggering operation on the permission control component, determining first responsive data controlled by the permission control component, and determining second responsive data bound to a preset permission instruction in the permission control component; In the case where the first responsive data and the second responsive data are bound, determining a first operation result of the trigger operation on the second responsive data, and, determining a second operation result of the trigger operation on the first responsive data through the preset permission instruction bound to the second responsive data; According to the first operation result and the second operation result, the page element to be re-rendered controlled by the permission control component is determined, and re-rendered to obtain a second page.
2. The method according to claim 1, characterized in that The preset authority instruction includes an insert instruction; Before displaying the permission control component on the first page, the method further includes: Determine the second responsive data and the insert instruction in the preset permission instruction bound to the second responsive data; Determine the relationship between the second responsive data and the first responsive data to obtain a determination result; According to the insertion instruction and the judgment result, a permission control component to be inserted into the first page is determined.
3. The method according to claim 2, characterized in that Determining, according to the insertion instruction and the judgment result, a permission control component to be inserted into the first page, including: If the judgment result indicates that the second responsive data and the first responsive data are bound to each other, the page permission corresponding to the first page is determined according to the second responsive data, and the role permission corresponding to the first page is determined according to the first responsive data; The permission control component corresponding to the page permission and the role permission is determined, and the permission control component is inserted into the first page through an insert instruction.
4. The method according to claim 2, characterized in that: Determining, according to the insertion instruction and the judgment result, a permission control component to be inserted into the first page, further comprising: If the judgment result indicates that there is no binding relationship between the second responsive data and the first responsive data, determining the page permission corresponding to the first page according to the second responsive data; The permission control component corresponding to the page permission is determined, and the permission control component is inserted into the first page through an insert instruction.
5. The method according to claim 1, characterized in that The method further comprises: In a case where the first responsive data and the second responsive data are not bound, determining a first operation result of the trigger operation on the second responsive data; According to the first operation result, the page element to be re-rendered controlled by the permission control component is determined, and re-rendered to obtain a second page.
6. The method according to claim 1, characterized in that The preset permission instruction includes an update instruction; the second operation result of the trigger operation on the first responsive data is determined by the preset permission instruction bound to the second responsive data, including: Obtaining a corresponding updated value of the first responsive data through the update instruction bound to the second responsive data; The updated value is compared with a preset value for the first response data to obtain a second operation result of the trigger operation on the first response data.
7. A page updating device, characterized in that: The device comprises: The permission control component display module is used to display the permission control component on the first page; A responsive data determination module, configured to determine, in response to a triggering operation on the permission control component, first responsive data controlled by the permission control component and second responsive data bound to a preset permission instruction in the permission control component; an operation result determination module, which determines, when the first responsive data and the second responsive data are bound, a first operation result of the trigger operation on the second responsive data, and determines, through the preset permission instruction bound to the second responsive data, a second operation result of the trigger operation on the first responsive data; The page rendering module determines the page elements to be re-rendered controlled by the permission control component according to the first operation result and the second operation result, and re-renders to obtain a second page.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.