Unified jump method and system for SAAS
By introducing the BLMShareUrlLink component into the SaaS platform, dynamic permission checksum link generation is realized, which solves the efficiency and security of page jumps between sub-projects, and improves the system's maintainability and user experience.
Patent Information
- Application Number
- CN202411926506.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-04
AI Technical Summary
The existing technology of page jumps between sub-projects in the SaaS platform have problems such as limited single-page application advantages, inconsistent with developer expectations, and the difficulty of unified management and retrieval.
Using a unified jump method and system for SAAS, the BLMShareUrlLink component realizes efficient and flexible page jump and permission control. This component obtains resource tree data from the global object, performs permission verification, and dynamically generates the complete URL of the target page, and finally realizes page redirection through the Router object provided by the dock.
It improves the efficiency and accuracy of page jumps, strengthens the security and user experience of the system, optimizes the flexibility and accuracy of permission control, reduces maintenance costs, and improves the scalability and maintainability of the system.
Smart Images

Figure CN119766535A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of routing systems, in particular to the optimization direction of the data structure of a SaaS (Software as a Service) platform page structure, and in particular to a unified jump method and system for SaaS. Background Art
[0002] In the development practice of SaaS platforms, in order to improve user experience and system maintainability, the micro-frontend architecture model is usually adopted. This architecture consists of a base (main application) and multiple sub-projects (micro-applications), which realizes the modularization of code and the independence of routing. Although this structure promotes smooth jumps within sub-projects, page jumps between sub-projects have become a technical challenge. In addition, given that the SaaS platform serves a wide range of users, including users in various positions in different organizations such as enterprises and institutions, such as operations, sales, customer service, etc., page access rights must be strictly controlled according to user roles. Therefore, before implementing page jumps, a strict permission verification process must be performed.
[0003] In order to solve the problem of jumping between sub-projects, many existing technologies attempt to optimize it, for example: CN201910191176.2 discloses a method, device, computer equipment and storage medium for generating a flowchart (publication date 2019-07-26); CN201910134025.3 discloses a malicious URL detection method combining multiple features (publication date 2019-06-21); CN202111350297.0 discloses a page processing method, device, computer equipment and storage medium (publication date 2022-01-24);
[0004] CN202311505140.X discloses a permission control method and a dynamic menu generation method based on Vue routing (publication date 2021-01-15); CN202410444257.X discloses a method and device for implementing a general mainstream media authorized homepage (publication date 2024-05-14); CN202011518966.6 discloses a SPA multi-page tab management method based on VUE (publication date 2021-04-20);
[0005] The above-mentioned prior art can be classified into the following types according to the characteristics of the jump technology:
[0006] (1) Based on the browser's native jump mechanism: using window.open, location.href,
[0007] Mechanisms provided by browsers such as tags;
[0008] (2) Based on the base Router jump mechanism: page navigation is realized through the Router object provided by the base application.
[0009] However, the above-mentioned prior arts all have the following technical problems:
[0010] (1) The advantages of single-page applications are limited: When the browser native jump method is used, the entire page will be reloaded, including the base and its static resources. This not only violates the original intention of single-page applications (SPA) to reduce page refreshes and improve interaction speed, but also affects the user experience.
[0011] If you use the traditional base router to jump, although you can maintain the characteristics of a single-page application, it is more complex.
[0012] (2) The jump logic does not meet the developer's expectations: Regardless of the jump method used, the developer must manually add permission verification logic before the jump. This step is contrary to the normal development process and is easily overlooked during the development process, leading to security risks.
[0013] (3) Unified management and retrieval are difficult: Due to the variety of jump methods and the decentralized permission verification logic, when it is necessary to uniformly sort out or retrieve jump-related information (such as the target path), the operator's professional knowledge and experience are required to be high, and omissions are prone to occur, affecting the stability and security of the system.
[0014] For example, a SaaS platform executes the business logic of an online car-hailing platform. The above defects are embodied as follows:
[0015] (1) The advantages of single-page applications are limited. Users often need to switch between different functional modules, such as switching from the ride-hailing page to the trip management page. If the browser native jump method is used, each switch will cause the entire page to refresh, which not only prolongs the user's waiting time, but also destroys the smoothness and continuity of the application. Moreover, each page refresh will reload the basic resources and framework of the application, which not only increases the burden on the server, but also leads to a waste of resources on the user's device. This effect is particularly obvious in the mobile network environment.
[0016] (2) The jump logic does not match the developer's expectations: Different user roles (such as passengers, drivers, and administrators) correspond to different functional permissions. When performing page jumps, developers need to manually add permission verification logic to ensure that users can only access pages within their permission range. However, this manual addition method is prone to errors and difficult to maintain. Moreover, since online ride-hailing platforms usually contain multiple sub-projects and functional modules, the jump logic becomes very complicated. Developers need to pass parameters and status between different sub-projects to ensure the accuracy and consistency of the jump. However, this complex jump logic often does not meet the developer's expectations and can easily lead to jump errors or user loss.
[0017] (3) Difficulty in unified management and retrieval: In online ride-hailing platforms, jump information is scattered across multiple sub-projects and functional modules. This makes it very difficult to uniformly manage and retrieve jump information. When the jump logic needs to be updated or modified, developers need to traverse the entire application code base to find relevant jump information. Moreover, due to the dispersion of jump information, the efficiency of retrieving relevant information is often very low. Developers need to spend a lot of time and energy to find and update jump logic, which not only affects development efficiency, but also leads to errors and omissions.
[0018] To this end, the present invention proposes a unified jump method and system for SAAS. Summary of the invention
[0019] In view of this, the present invention hopes to provide a unified jump method and system for SAAS to solve or alleviate the technical problems existing in the prior art, namely, the limited advantages of single-page applications, the jump logic not meeting the expectations of developers, and the difficulty of unified management and retrieval, and at least provide a beneficial option for this; the technical solution of the present invention is implemented as follows:
[0020] First, a unified redirection method for SAAS:
[0021] 1. Overview:
[0022] The present invention aims to build an efficient and flexible page jump and permission control mechanism, which is implemented with the BLMShareUrlLink component as the core. The component obtains resource tree data from the global object, contains key elements such as page permission information and URL, and provides a basis for subsequent permission verification and link generation. When a user tries to access the target page, the component first performs permission verification to ensure that the user has access rights; then, based on the incoming parameters and resource tree data, the complete URL of the target page is dynamically generated. In addition, the scheme also includes link validity verification and component content display / hiding logic to ensure the friendliness of the user interface and the accuracy of operation. Finally, page jump is realized through the Router object provided by the base, and feedback processing is supported in the case of jump failure or no permission. This scheme not only improves the efficiency and accuracy of page jump, but also enhances the security and user experience of the system.
[0023] (II) Technical solution:
[0024] To achieve the above technical objectives, when the system is triggered and activated (such as clicked or program called), the present invention selects to execute the following operation steps.
[0025] 2.1 Step S1, resource tree acquisition:
[0026] Execution entity: BLMShareUrlLink component;
[0027] The BLMShareUrlLink component obtains resource tree data (window.$BLM_BASE_GLOBAL_AUTH_RESOURCE) including page permissions and URLs from the global object (window).
[0028] 2.1.1 Step S100, data acquisition:
[0029] If the resource tree data exists, the component stores it in an internal variable for subsequent use.
[0030] If the resource tree data does not exist or is empty, the component triggers the error handling mechanism, such as displaying an error message or performing a fallback operation.
[0031] 2.1.2 Step S101, data cache:
[0032] Cache resource tree data locally or in memory to reduce frequent access to global objects.
[0033] 2.2 Step S2, permission verification:
[0034] Execution entity: permission verification module in the BLMShareUrlLink component;
[0035] The authority verification module checks whether the user has the authority to access the target page based on the pk (pageKey) and the resource tree data. If the user does not have the authority, step S7 is executed; if the user has the authority, the next step is entered.
[0036] 2.2.1 Step S200, input parameter analysis:
[0037] The permission check module receives the incoming pk (pageKey) as an input parameter, searches for the corresponding page permission information in the resource tree data based on pk, and checks whether the user has the permission to access the page, including checking the user's role, permission level, or specific permission items.
[0038] 2.2.2 Step S201, result processing:
[0039] If the user has the permission, the permission verification module returns a success result and allows the process to enter the next step. If the user does not have the permission, the permission verification module returns a failure result and triggers the error handling mechanism (execution step S7).
[0040] 2.3 Step S3, generate target link:
[0041] Execution entity: link generation module in BLMShareUrlLink component;
[0042] The link generation module uses the compileParams function and the compileQuery function to generate the complete URL of the target page based on the incoming pk, query, params, and URL in the resource tree data.
[0043] 2.3.1 Step S300, input parameter analysis:
[0044] The link generation module receives the incoming pk, query, and params as input parameters, and obtains the page URL template corresponding to pk from the resource tree data.
[0045] 2.3.2 Step S301, parameter processing:
[0046] The module uses the compileParams function to process path parameters (params) and embed them into the corresponding position in the URL template;
[0047] The module uses the compileQuery function to process the query parameter (query) and concatenate it into the query string part of the URL.
[0048] 2.3.3 Step S302, link generation:
[0049] The module generates a complete URL for the target page based on the processed path parameters and query parameters, as well as the URL template.
[0050] 2.3.4 Step S303, link verification:
[0051] After generating the link, the module checks whether the link points to a valid page to ensure that the link is valid; if so, it proceeds to the next step, otherwise it proceeds to S7.
[0052] 2.3.5 Step S304, output link:
[0053] The module returns the generated target link to the BLMShareUrlLink component.
[0054] 2.4 Step S4, determine whether the target link is valid:
[0055] Link verification module in the BLMShareUrlLink component;
[0056] The link verification module checks whether the generated target link is an unauthorized identifier. If yes, step S7 is executed; if not, the next step is entered.
[0057] 2.4.1 Step S400, input link to obtain:
[0058] The link verification module receives the generated target link from the link generation module as input, and checks whether the target link contains an unauthorized identifier (such as / 403) through string matching or regular expression.
[0059] If the link contains an unauthorized identifier, it means that the user does not have permission to access the page, and the module returns a verification failure result. If the link does not contain an unauthorized identifier, it means that the link is valid, and the module returns a verification success result.
[0060] 2.4.2 Step S401, result processing:
[0061] Based on the verification result, the module decides whether to continue to execute the next step or directly jump to step S7.
[0062] 2.5 Step S5, display or hide component content:
[0063] Execution entity: rendering module of BLMShareUrlLink component;
[0064] The rendering module decides whether to display or hide the sub-element of the component (i.e. the jump button) based on the permission check result. If the user has permission, the button is displayed; if not, the button is hidden.
[0065] 2.5.1 Step S500, obtaining permission results:
[0066] The rendering module receives the result of the permission verification from the permission verification module.
[0067] If the permission check succeeds, it means that the user has permission to access the target page, and the rendering module displays the sub-elements of the BLMShareUrlLink component (such as the jump button). If the permission check fails, it means that the user does not have permission to access the target page, and the rendering module hides the sub-elements of the BLMShareUrlLink component.
[0068] 2.5.2 Step S501, interface update:
[0069] The rendering module updates the interface based on the permission verification results to ensure that the content the user sees is consistent with the permission status.
[0070] 2.6 Step S6, execute jump:
[0071] Execution subject: jump execution module in BLMShareUrlLink component;
[0072] The jump execution module starts the Router object (window.$baseRouter) provided by the base to execute the page jump based on the user clicking the jump button. At the same time, the pushPath function is called, the generated target link is passed as a parameter, and the jump operation is executed.
[0073] 2.6.1 Step S600, user click detection:
[0074] The jump execution module monitors the event of the user clicking the jump button; when the user clicks the jump button, the module obtains the generated target link.
[0075] At the same time, other jump-related parameters or configurations need to be obtained, including the jump mode (synchronous or asynchronous) and the processing logic after the jump.
[0076] 2.6.2 Step S601, execute jump:
[0077] The module calls the pushPath function of the Router object provided by the base (such as window.$baseRouter), passes the target link as a parameter, and performs a page jump operation.
[0078] After the jump is completed, the module executes the update page status and records the jump history.
[0079] 2.7 Step S7, end or enter loop:
[0080] Execution entity: logical control module of BLMShareUrlLink component;
[0081] The logic control module ends the current process based on the situation that the user has no permission or the jump fails; when the page jump is completed or the user cannot jump due to lack of permission, the processing flow of the BLMShareUrlLink component ends and returns a corresponding feedback to the user (such as jump success page, no permission prompt, etc.).
[0082] 2.7.1 Step S700, process end judgment:
[0083] The logic control module determines whether the current process is ended based on the permission check result or the jump execution result. If the user does not have permission or the jump fails, the current process is ended. If the user has permission and the jump is successful, the next process cycle (if any) is entered.
[0084] 2.7.2 Step S701, user feedback:
[0085] Depending on the reason for the end of the process, the module returns corresponding feedback to the user. If the user does not have permission, the module displays a prompt that the user does not have permission; if the jump is successful, the module displays the jump success page.
[0086] 2.7.3 Step S702, state reset (optional):
[0087] After the process ends, the module resets the state or variables to prepare for the next process execution.
[0088] (III) Mechanism for solving technical problems:
[0089] 3.1 Core Mechanism:
[0090] 3.1.1 Global resource tree management:
[0091] The present invention stores page permissions and URL information through a global object (such as window) to form a resource tree data structure (such as
[0092] window.$BLM_BASE_GLOBAL_AUTH_RESOURCE). This centralized management method allows permissions and URL information to be uniformly accessed and updated throughout the application, facilitating unified management and retrieval.
[0093] 3.1.2 Dynamic permission verification and link generation:
[0094] The BLMShareUrlLink component will perform dynamic permission verification before redirection. It will determine whether the user has the right to access the target page based on the passed-in page identification key (pk), query parameter (query) and path parameter (params), combined with the resource tree data. At the same time, the compileParams and compileQuery functions are used to dynamically generate a complete target URL to ensure that the redirection logic is consistent with the developer's expectations.
[0095] 3.1.3 Combining the base Router with custom jump logic:
[0096] The present invention not only relies on the Router object of the base to realize page jump, but also encapsulates the customized jump logic through the BLMShareUrlLink component. This includes permission verification, link generation, and post-jump processing (such as feedback when the jump fails or there is no permission). This combination not only utilizes the jump capability of the base Router, but also enhances the flexibility and controllability of the jump logic.
[0097] 3.2 Principle Overview:
[0098] 3.2.1 Global state sharing:
[0099] Use JavaScript's global objects (such as window) as state sharing containers to store application-level state information (such as page permissions and URL resource trees). This mechanism allows any component or module to access and modify this state information, thereby achieving cross-component state sharing and unified management.
[0100] 3.2.2 Dynamic route generation:
[0101] Through the idea of functional programming, the processing logic of path parameters and query parameters is encapsulated into reusable functions (such as compileParams and compileQuery). These functions dynamically generate the target URL based on the passed parameters and resource tree data, realizing dynamic generation and flexible configuration of routes.
[0102] 3.2.3 Middleware mode:
[0103] The BLMShareUrlLink component acts as a middleware in the redirect process. It intercepts the redirect request, performs pre-operations such as permission verification and link generation, and decides whether to continue the redirect or return error feedback based on the verification results. This mechanism makes the redirect logic clearer and more controllable, making it easier for developers to debug and optimize.
[0104] 3.2.4 Event-driven and callback:
[0105] In the jump process, the present invention also uses event-driven and callback mechanisms to handle the behavior after the jump. For example, some additional logic (such as page initialization operations) can be executed after the jump is successful, and error feedback can be returned and the user can be prompted when the jump fails or there is no permission. This mechanism makes the jump process more flexible and scalable.
[0106] Second, a unified jump system for SAAS:
[0107] like Figure 3As shown, it includes a BLMShareUrlLink component for implementing the unified jump method for SAAS described above, and the submodules of the BLMShareUrlLink component include:
[0108] (1) The permission verification module is responsible for checking whether the user has permission to access the target page based on the page identification key (pk) and resource tree data passed in. It is part of the BLMShareUrlLink component and interacts with other parts of the component through function calls.
[0109] (2) Link generation module responsible for generating URLs: This module is responsible for dynamically generating the complete URL of the target page based on the passed-in parameters and resource tree data. It is also part of the BLMShareUrlLink component and interacts with the permission verification module and the jump execution module through function calls.
[0110] (3) A link verification module responsible for checking whether the generated target link is valid: that is, whether it is an unauthorized identifier (such as / 403). It is a submodule of the BLMShareUrlLink component and interacts with the link generation module and the logic control module through function calls.
[0111] (4) Rendering module that performs sub-element rendering: This module is responsible for deciding whether to display or hide the sub-elements (such as the jump button) of the BLMShareUrlLink component based on the permission verification result. It is a part of the component and interacts with other parts of the component through DOM operations or the rendering mechanism provided by the framework.
[0112] (5) Jump execution module for executing object jump: This module is responsible for starting the Router object provided by the base to execute page jump when the user clicks the jump button. It is also part of the BLMShareUrlLink component and interacts with the base by calling the methods of the Router object and passing the generated URL.
[0113] (6) The logic control module that controls the processing flow of the entire BLMShareUrlLink component: including ending the process, handling jump failure or no permission, and returning corresponding feedback to the user. It is the core logic part of the component and interacts with other parts of the component through conditional judgment and function calls.
[0114] Compared with the prior art, the present invention has the following beneficial effects:
[0115] 1. Improve the flexibility and accuracy of permission control: Through the dynamic permission verification mechanism, the present invention can check the permissions of users in real time when they try to access a page, ensuring that only users with corresponding permissions can access it. This greatly improves the flexibility and accuracy of permission control and effectively prevents unauthorized access.
[0116] 2. Optimize page jump logic to meet developer expectations: The present invention can generate a target URL that meets developer expectations by customizing jump logic and combining path parameters and query parameters. This avoids the logic inconsistency problem in traditional jump mechanisms and ensures the accuracy and reliability of page jumps.
[0117] 3. Realize unified management and retrieval, and reduce maintenance costs: Through global resource tree management, the present invention stores page permissions and URL information in a centralized data structure, which is convenient for unified management and retrieval. This reduces maintenance costs, improves development efficiency, and also facilitates subsequent expansion and upgrades.
[0118] 4. Enhance user experience and interface friendliness: The BLMShareUrlLink component dynamically displays or hides the jump button according to the permission check result, avoiding the embarrassing situation when the user cannot access the page due to lack of permission. At the same time, the present invention also provides friendly feedback when the jump fails or there is no permission, enhancing user experience and interface friendliness.
[0119] 5. Improve the scalability and maintainability of the system: The present invention adopts modular design, encapsulating the logic of permission verification, link generation, jump execution, etc. in independent modules. This design method improves the scalability and maintainability of the system, making it easier for developers to add new functions or modify existing logic.
[0120] 6. Support multiple jump scenarios to meet diverse needs: The present invention not only supports simple page jumps, but also supports jumps with parameters, cross-domain jumps, etc. This meets the diverse jump requirements in application development and provides developers with greater flexibility and convenience. BRIEF DESCRIPTION OF THE DRAWINGS
[0121] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or 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 drawings can be obtained based on these drawings without paying creative work.
[0122] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0123] Figure 2It is a schematic diagram of the steps of executing the method of the present invention;
[0124] Figure 3 It is a schematic diagram of the system composition of the present invention. DETAILED DESCRIPTION
[0125] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below;
[0126] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0127] Explanation of relevant terms:
[0128] (1) BLMShareUrlLink component: a functional module that implements page jump and permission control.
[0129] (2) Global object (window): The top-level object in the browser, used to store and access global variables and functions.
[0130] (3) Page permissions and URL resource tree data (window.$BLM_BASE_GLOBAL_AUTH_RESOURCE): A data structure stored on the global object, containing page access permissions and corresponding URL information.
[0131] (4) pk (pageKey): page identification key, used to uniquely identify a page.
[0132] (5)query: Query parameter used to pass additional information in the URL.
[0133] (6) params: path parameters, usually used to dynamically generate part of the URL.
[0134] (7) compileParams function and compileQuery function: These two functions are used to process and concatenate path parameters and query parameters to generate a complete URL.
[0135] (8)Router object: An object that provides page jump functionality, usually containing multiple routing-related methods and properties.
[0136] (9) pushPath function: A method provided by the Router object, used to push the generated URL to the browser history to achieve page jump.
[0137] (10) Passing the generated target link as a parameter: This means that when calling the pushPath function, the previously generated target URL is passed in as a parameter to perform a page jump.
[0138] Embodiment 1: Figure 1 As shown, a ride-hailing SAAS platform is provided, and there are multiple pages on the platform, such as the home page, order page, and driver management page. In order to realize the jump between pages and ensure that users can only access the pages they have permission to, the BLMShareUrlLink component of the unified jump method for SAAS disclosed in this embodiment is used to process the page jump logic.
[0139] In this embodiment, regarding step S1: resource tree acquisition
[0140] Execution entity: BLMShareUrlLink component;
[0141] Specific implementation: When the user logs in to the platform, the BLMShareUrlLink component obtains the page permissions and URL resource tree data from the global object window. These data are stored in JSON format and include the pageKey, URL template, and permission information required to access each page.
[0142] Effect and principle: By centrally managing page permissions and URLs, you can easily perform permission verification and link generation. This step is the basis for subsequent steps.
[0143] Specifically, step S100: data acquisition:
[0144] Judgment condition: whether the resource tree data exists
[0145] Action: If the data exists, the component stores it in an internal variable; if the data does not exist or is empty, the component displays an error message, such as "Failed to load resource tree data", and falls back to the default page.
[0146] Specifically, step S101: data cache:
[0147] Action: Cache resource tree data in local storage (such as localStorage) or memory to reduce frequent access to global objects and improve performance.
[0148] In this embodiment, regarding step S2: authority verification:
[0149] Execution entity: permission verification module in the BLMShareUrlLink component;
[0150] Input parameters: pageKey of the page the user is trying to access;
[0151] Specific implementation: The permission verification module checks whether the user has permission to access the target page based on the passed pageKey and resource tree data. This usually involves checking the user's role, permission level, or specific permission items.
[0152] Effect and principle: Through permission verification, it can ensure that users can only access pages for which they have permission, preventing unauthorized access. This step is the key to achieving page security.
[0153] Specifically, step S200: input parameter analysis:
[0154] Operation: The permission verification module receives the incoming pageKey and searches for the corresponding page permission information in the resource tree data.
[0155] Specifically, step S201: result processing:
[0156] Judgment condition: whether the user has permission;
[0157] Operation: If the user has permission, a success result is returned; if the user does not have permission, a failure result is returned and the error handling mechanism is triggered.
[0158] In this embodiment, regarding step S3: generating a target link:
[0159] Execution entity: link generation module in BLMShareUrlLink component;
[0160] Input parameters: pageKey, query parameters (query), path parameters (params);
[0161] Specific implementation: The link generation module uses the compileParams function and the compileQuery function to generate the complete URL of the target page according to the passed parameters and the URL template in the resource tree data.
[0162] Effect and principle: By dynamically generating links, you can easily jump between pages and carry necessary parameters. This step is the core of page jump.
[0163] Specifically, step S300: input parameter analysis:
[0164] Operation: The link generation module receives the passed parameters and obtains the page URL template corresponding to the pageKey from the resource tree data.
[0165] Specifically, step S301: parameter processing:
[0166] Action: Use the compileParams function to process path parameters and embed them into the URL template; use the compileQuery function to process query parameters and concatenate them into the query string part of the URL.
[0167] Specifically, step S302: link generation:
[0168] Action: Generate a complete URL of the target page based on the processed parameters and URL template.
[0169] Specifically, step S303: link verification:
[0170] Action: Check whether the generated link points to a valid page to ensure the validity of the link.
[0171] Specifically, step S304: output link:
[0172] Action: Return the generated target link to the BLMShareUrlLink component.
[0173] In this embodiment, regarding step S4: determining whether the target link is valid:
[0174] Execution entity: Link verification module in BLMShareUrlLink component
[0175] Input parameters: generated target link;
[0176] Specific implementation: The link verification module checks whether the generated target link contains an unauthorized identifier (such as / 403). If it does, it means that the user does not have permission to access the page; if it does not, it means that the link is valid.
[0177] Effect and principle: This step of verification can further ensure that users can only access pages for which they have permission, preventing the bypassing of permission verification by illegal means.
[0178] Specifically, step S400: input link to obtain:
[0179] Operation: The link verification module receives the generated target link from the link generation module.
[0180] Specifically, step S401: result processing:
[0181] Judgment condition: whether the link is valid;
[0182] Operation: If the link is valid, proceed to the next step; if the link is invalid, proceed to step S7.
[0183] In this embodiment, regarding step S5: displaying or hiding component content:
[0184] Execution entity: rendering module of BLMShareUrlLink component;
[0185] Input parameters: permission verification result;
[0186] Specific implementation: The rendering module decides whether to display or hide the sub-elements of the component (such as the jump button) based on the permission check result. If the user has permission, the button is displayed; if not, the button is hidden.
[0187] Effect and principle: Through this step of processing, the jump button can be dynamically displayed or hidden according to the user's permission status to improve the user experience. At the same time, it can also prevent users from clicking on the jump button without permission and causing errors.
[0188] Specifically, step S500: obtaining permission results:
[0189] Operation: The rendering module receives the result of the permission check from the permission check module.
[0190] Specifically, step S501: interface update:
[0191] Action: Update the interface based on the permission verification results to ensure that the content the user sees is consistent with the permission status.
[0192] In this embodiment, regarding step S6: executing jump:
[0193] Execution subject: jump execution module in BLMShareUrlLink component;
[0194] Trigger condition: User clicks the jump button;
[0195] Specific implementation: The jump execution module listens to the event of the user clicking the jump button. When the user clicks, it obtains the generated target link and calls the pushPath function of the Router object provided by the base (such as window.$baseRouter) to execute the page jump.
[0196] Effect and principle: By monitoring user click events and executing jump operations, seamless switching between pages can be achieved. At the same time, the Router object provided by the base can ensure the uniformity and standardization of the jump.
[0197] Specifically, step S600: user click detection:
[0198] Operation: The jump execution module listens to the event of the user clicking the jump button and obtains the generated target link and other jump-related parameters.
[0199] Specifically, step S601: execute jump:
[0200] Operation: Call the pushPath function of the Router object to perform the page jump operation and record the jump history.
[0201] In this embodiment, regarding step S7: ending or entering a loop:
[0202] Execution entity: logical control module of BLMShareUrlLink component
[0203] Specific implementation: The logic control module determines whether the current process is ended based on the permission check result or the jump execution result. If the user does not have permission or the jump fails, the current process ends and a corresponding feedback is returned to the user (such as a prompt of no permission, a prompt of jump failure, etc.); if the user has permission and the jump is successful, the next process cycle (if any) is entered.
[0204] Effect and principle: This step can ensure the integrity and standardization of the process. At the same time, returning corresponding feedback to users can improve user experience and system friendliness.
[0205] Specifically, step S700: process end judgment:
[0206] Operation: The logic control module determines whether the current process is completed based on the permission check result or the jump execution result.
[0207] Specifically, step S701: user feedback:
[0208] Action: Return appropriate feedback to the user based on the reason why the process ended.
[0209] Specifically, step S702: state reset (optional):
[0210] Operation: Reset the state or variables after the process ends to prepare for the next process execution. This ensures that each process execution is carried out in a clean state and avoids problems caused by the state left over from the previous process execution.
[0211] In summary, in single-page applications, page jumps are usually achieved through routing. However, if the routing is improperly configured or the permission check is not strict, users will access pages without permission. This problem can be effectively solved through the permission check and link generation module of the BLMShareUrlLink component. Even in single-page applications, it can ensure that users can only access pages for which they have permission.
[0212] In a complex system, the jump logic between pages can become very complicated. Through the unified management and standardized processing of the BLMShareUrlLink component, it can be ensured that the jump logic is consistent with the developer's expectations. At the same time, through steps such as link verification and permission verification, problems such as unauthorized access or inaccessible pages caused by jump logic errors can be prevented.
[0213] In the traditional page jump method, each page needs to configure the jump logic and permission verification logic separately. This makes management and retrieval very difficult. Through the centralized management and unified processing of the BLMShareUrlLink component, the page jump logic and permission information can be easily managed and retrieved. At the same time, the system performance and response speed can be improved through the caching and optimization of resource tree data.
[0214] Embodiment 2: Figure 2 As shown, this embodiment further discloses the JSX execution program of the solution of embodiment 1:
[0215]
[0216]
[0217]
[0218]
[0219]
[0220] The principle of the above procedure is:
[0221] (1) Resource tree acquisition: from the global
[0222] Like window.$BLM_BASE_GLOBAL_AUTH_RESOURCE to get the resource tree data, which is the source of permissions and URL mappings.
[0223] (2) Generate target link:
[0224] The compileQuery and compileParams functions are used to compile query parameters and path parameters into the URL.
[0225] The linkGenerate function generates a target URL based on the passed pk (page keyword), params (path parameters), query (query parameters), and resource tree. If there is no permission, a 403 page URL is returned.
[0226] (3) Permission check: The hasResourceAuth function checks whether the user has permission to access a specific page.
[0227] (4) Permission-related scenario processing: Based on the permission verification results, decide whether to render the passed-in child components (children).
[0228] (5) Implement the redirect function: The pushPath function uses the URL generated by linkGenerate to redirect the page. If window.$baseRouter is not defined or the target URL is a 403 page, no redirect will be performed.
[0229] Finally, the BLMShareUrlLink component will render a link button on the page according to the configuration. When the user clicks it, the page will jump according to the permissions and configuration.
[0230] All the above embodiments only express the implementation methods of the relevant practical applications of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
[0231] For those skilled in the art, it can be further appreciated that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0232] At the same time, those skilled in the art can understand that all or part of the processes in all the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Claims
1. A unified jump method for SAAS, characterized in that: include: S1: Get resource tree data from the global object, including page permissions and URLs; S2: Check the user's permissions based on the pageKey and resource tree data passed in; if there is no permission, execute step S7, otherwise proceed to the next step; S3: Generates the target URL based on pageKey and resource tree data; S4: Check whether the target link is an unauthorized identifier, if yes, execute S7, otherwise proceed to the next step; S5: Display or hide the jump button according to the permission verification result; S6: execute jump based on user click; S7: Return user feedback when there is no permission or the redirect fails.
2. The unified jump method according to claim 1, characterized in that: The implementation method of S1 includes: S100, if the resource tree data exists, the component stores it in an internal variable; if the resource tree data does not exist or is empty, the component triggers an error handling mechanism; S101, cache resource tree data locally or in memory.
3. The unified jump method according to claim 1, characterized in that: The implementation method of S2 includes: S200, the permission verification module receives the incoming page identification key and resource tree data, and checks the user's role, permission level or specific permission item; if there is no permission, execute S7; if there is permission, proceed to the next step; S201, if the user has permission, the permission verification module returns a success result and allows the process to enter the next step; if the user does not have permission, a failure result is returned and an error handling mechanism is triggered.
4. The unified jump method according to claim 1, characterized in that: The implementation method of S3 includes: S300, obtaining a page URL template corresponding to the page identification key from the resource tree data; S301, process the path parameter and embed it into the corresponding position in the URL template; process the query parameter and splice it into the query string part of the URL; S302, the module generates a complete URL of the target page according to the processed path parameters and query parameters and the URL template; S303, after the link is generated, check whether the link contains illegal characters or points to a valid page to ensure whether the link is valid; if valid, proceed to the next step, otherwise proceed to S7; S304, returning the generated target link.
5. The unified jump method according to claim 1, characterized in that: The implementation method of S4 includes receiving the generated target link from the link generation module as input, and checking whether the target link contains an unauthorized identifier through string matching or regular expression.
6. The unified jump method according to claim 1, characterized in that: The implementation method of S5 includes: S500, receiving the result of the permission verification from the permission verification module; if the permission verification is successful, jump to the button; otherwise, hide the button; S501, updating the interface according to the permission verification result.
7. The unified jump method according to claim 1, characterized in that: The implementation method of S6 includes: S600, when the user clicks the jump button, the module obtains the generated target link, and obtains the jump mode and the processing logic after the jump; S601, the module calls the Router object provided by the base, passes the target link as a parameter, and performs a page jump operation.
8. The unified jump method according to claim 1, characterized in that: In S7, if the user does not have permission or the jump fails, it is decided to end the current process; If the user has permission and the jump is successful, enter the next process loop.
9. A unified redirection system for SAAS, characterized in that the system comprises: a BLMShareUrlLink component for implementing the unified redirection method for SAAS as described in any one of claims 1 to 8.
10. The system according to claim 9, characterized in that: The BLMShareUrlLink component includes: A permission verification module responsible for checking the page identification key and resource tree data passed in; A link generation module responsible for generating URLs; A link verification module responsible for checking whether the generated target link is valid; A rendering module that performs child element rendering; A jump execution module for executing object jumps; The logic control module that controls the processing flow of the entire BLMShareUrlLink component.
Citation Information
Patent Citations
A malicious URL detection method combining multiple features
CN109922052B
Flow chart generation method and device, computer equipment and storage medium
CN110058849A
A Vue-based SPA multi-tab management method
CN112685663B
Page processing method and device, computer equipment and storage medium
CN113934425A
Vue routing-based authority control method and dynamic menu generation method
CN117544360A