Page processing method and device, electronic equipment and storage medium
By receiving cross-domain communication messages and parsing target routing records, the problem of mismatch between the base application address and the sub-application address in the micro front-end framework is solved, and the availability of the micro front-end framework is improved to ensure that different devices can correctly open the sub-application page.
Patent Information
- Application Number
- CN202310708710.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-12-17
AI Technical Summary
The address of the base application in the micro front-end framework is generated by random routing encoding, and has nothing to do with the real address of the sub-application, which causes other devices to be unable to open the same sub-application through the same address, reducing the availability of the micro front-end.
By receiving cross-domain communication messages, based on the target sub-application encoding in the message, the target routing record is determined from the routing table, the first web page address is obtained, and the target tag page associated with the message is determined based on the address, the target tag page is processed, and the target tag page is realized. The parsing of cross-domain communication messages and the correct opening of the target page.
It effectively overcomes the routing distribution problem, improves the availability of the micro front-end framework, and enables different devices to open the same page based on the same address.
Smart Images

Figure CN119148896A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a page processing method, device, electronic device and storage medium. Background Art
[0002] With the development of front-end applications, the size of front-end applications has gradually increased, and the deployment and compilation time has also increased accordingly. To solve this problem, a micro-front-end solution has been proposed in related technologies, which is to split the front-end application into multiple sub-applications, and then aggregate the multiple sub-applications into one entry, namely the base application.
[0003] In the process of implementing the concepts disclosed herein, the inventors discovered that there are at least the following problems in the related art: in the related art, the address of the base application is generally generated by random routing coding, which has nothing to do with the real address of the sub-application, making it impossible for other devices to open the same sub-application through the same address, resulting in poor availability of the micro-frontend. Summary of the invention
[0004] In view of this, the present disclosure provides a page processing method, apparatus, electronic device, readable storage medium and computer program product.
[0005] One aspect of the present disclosure provides a page processing method, including: in response to receiving a cross-domain communication message, based on the target sub-application code included in the cross-domain communication message, determining a target routing record corresponding to the cross-domain communication message from a routing table; based on the target routing record, obtaining a first web page address; based on the first web page address, determining a target tag page associated with the cross-domain communication message; and based on the message type of the cross-domain communication message, processing the target tag page.
[0006] According to an embodiment of the present disclosure, determining the target tag page associated with the cross-domain communication message based on the first web page address includes: performing a summary calculation on the first web page address to obtain a summary value; and determining the target tag page based on the summary value.
[0007] According to an embodiment of the present disclosure, determining the target tag page based on the summary value includes: using the component name of at least one micro-frontend component corresponding to at least one tag page included in the tag bar to compare with the summary value to obtain a comparison result; and when the comparison result indicates that the summary value is consistent with the component name of the first micro-frontend component, determining the tag page corresponding to the first micro-frontend component as the target tag page.
[0008] According to an embodiment of the present disclosure, the message type of the above-mentioned cross-domain communication message includes an open tag type; wherein, based on the message type of the above-mentioned cross-domain communication message, processing the above-mentioned target tag page includes: when the message type of the above-mentioned cross-domain communication message is the above-mentioned open tag type, running the above-mentioned first micro-front-end component, jumping to the above-mentioned target tag page, and displaying the target page.
[0009] According to an embodiment of the present disclosure, the method further includes: when the comparison result indicates that the summary value is inconsistent with the component name of at least one micro-front-end component, creating the target tag page based on the message content of the cross-domain communication message.
[0010] According to an embodiment of the present disclosure, the above-mentioned message type based on the above-mentioned cross-domain communication message processes the above-mentioned target tab page, including: using the above-mentioned summary value as the component name, using the above-mentioned first web page address as the access address, and generating a second micro-front-end component based on the component template; and registering the above-mentioned second micro-front-end component to run the above-mentioned second micro-front-end component, and opening the above-mentioned target page in the above-mentioned target tab page.
[0011] According to an embodiment of the present disclosure, the above-mentioned creation of the target tag page based on the message content of the above-mentioned cross-domain communication message includes: generating a second web page address based on a preset domain name and the message content of the above-mentioned cross-domain communication message; and creating the above-mentioned target tag page based on the above-mentioned second web page address.
[0012] According to an embodiment of the present disclosure, the message type of the above-mentioned cross-domain communication message includes a close tag type; wherein, based on the message type of the above-mentioned cross-domain communication message, processing the above-mentioned target tag page includes: when the message type of the above-mentioned cross-domain communication message is the above-mentioned close tag type, closing the above-mentioned first micro-front-end component to close the above-mentioned target tag page.
[0013] According to an embodiment of the present disclosure, the above method also includes: in response to receiving the above cross-domain communication message, using a routing table to verify access rights based on the message content of the above cross-domain communication message; and in the case of determining that the access rights are available, based on the target sub-application code included in the above cross-domain communication message, determining the target routing record corresponding to the above cross-domain communication message from the routing table.
[0014] According to an embodiment of the present disclosure, the above-mentioned use of the routing table to verify access rights based on the message content of the above-mentioned cross-domain communication message includes: matching the message content of the above-mentioned cross-domain communication message with the multiple routing records included in the above-mentioned routing table in sequence to obtain a matching result; and determining that access rights are granted when the above-mentioned matching result indicates that the message content of the above-mentioned cross-domain communication message matches the above-mentioned target routing record in the above-mentioned multiple routing records.
[0015] According to an embodiment of the present disclosure, the above method also includes: when the above matching result indicates that the message content of the above cross-domain communication message does not match the above multiple routing records, determining that there is no access right; and when it is determined that there is no access right, opening a preset page in the current tab page.
[0016] According to an embodiment of the present disclosure, obtaining the first web page address based on the target routing record includes: parsing the target routing record to obtain the target domain name and target path parameter information; and obtaining the first web page address based on the target domain name and the target path parameter information.
[0017] According to an embodiment of the present disclosure, the method further includes: calling a menu authority system interface to obtain a menu tree; and registering multiple sub-items included in the menu tree in a global route to obtain the routing table.
[0018] According to an embodiment of the present disclosure, the multiple sub-items included in the above-mentioned menu tree are registered in the global route to obtain the above-mentioned routing table, including: respectively parsing the web page addresses of the above-mentioned multiple sub-items to obtain the sub-application codes and path parameter information of the above-mentioned multiple sub-items; for each sub-item, registering the sub-application code and path parameter information of the above-mentioned sub-item in the global route to obtain the routing record of the above-mentioned sub-item; and writing the routing paths of the above-mentioned multiple sub-items into the initial routing table to obtain the above-mentioned routing table.
[0019] Another aspect of the present disclosure provides a page processing device, including: a first determination module, used to determine, in response to receiving a cross-domain communication message, a target routing record corresponding to the cross-domain communication message from a routing table based on a target sub-application code included in the cross-domain communication message; a first processing module, used to obtain a first web page address based on the target routing record; a second determination module, used to determine a target tag page associated with the cross-domain communication message based on the first web page address; and a second processing module, used to process the target tag page based on the message type of the cross-domain communication message.
[0020] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method described above.
[0021] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0022] Another aspect of the present disclosure provides a computer program product, the computer program product comprising computer executable instructions, and the instructions are used to implement the above method when executed.
[0023] According to an embodiment of the present disclosure, the web page address entered in the base application can be converted into a cross-domain communication message. Alternatively, the user clicks a button in any tab page, and the link corresponding to the button can be converted into a cross-domain communication message. The target routing record that matches the message content of the cross-domain communication message can be determined from the routing table, and then the first web page address, that is, the web page address actually used by the sub-application can be determined based on the target routing record and the target sub-application code included in the cross-domain communication message. Afterwards, the target tab page can be determined by creating a new page, matching, etc., and corresponding operations can be performed on the target tab page according to the message type of the cross-domain communication message. Through the routing table, it is possible to parse the cross-domain communication message to obtain the first web page address, which can at least partially overcome the routing distribution problem existing in the related art, thereby effectively improving the availability of the micro-frontend framework. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0025] Figure 1 An exemplary system architecture to which the page processing method and apparatus according to an embodiment of the present disclosure can be applied is schematically shown.
[0026] Figure 2 The flowchart of the page processing method according to the embodiment of the present disclosure is schematically shown.
[0027] Figure 3 A schematic diagram of a micro front-end framework according to an embodiment of the present disclosure is schematically shown.
[0028] Figure 4 The flowchart of the method for generating a routing table according to an embodiment of the present disclosure is schematically shown.
[0029] Figure 5 The flowchart of a page processing method according to another embodiment of the present disclosure is schematically shown.
[0030] Figure 6 The following schematically shows a flow chart of a page processing method according to another embodiment of the present disclosure.
[0031] Figure 7 The block diagram of a page processing device according to an embodiment of the present disclosure is schematically shown.
[0032] Figure 8 A block diagram of an electronic device suitable for implementing a page processing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0033] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0034] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0035] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0036] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0037] The application of the micro-frontend framework in the related art generally implements address management based on the menu permission system, and opens the sub-application page through the micro-frontend component. Specifically, for each button on the page, the menu permission system can configure the address to be opened after clicking the button, and the micro-frontend component can be used to open the corresponding address after clicking the button. There are generally two scenarios for its application, namely, the scenario of pages with fixed access addresses and the scenario of pages without fixed access addresses.
[0038] In the scenario of pages with fixed access addresses, developers can configure menu codes in the menu permission system in advance. The base application can call the menu permission system interface to obtain the menu tree, and register the menu data included in the menu tree to the global route by dynamically registering the route. Each menu item can use the menu code of the current menu item and the menu code of the parent menu item to form the access address of the base application, and use the address field in the menu item as a resource for the micro-frontend component. When the base application can access the corresponding menu, it can query the address that needs to be accessed by the front-end component through the address of the current base application. However, since the path of each menu item is composed of the menu code of the current menu item and the menu code of the parent menu item, and because the menu code is customized by the developer when configuring the menu permission system, the generated access address of the base application is generally unrelated to the real address required for the actual access of the front-end component. For example, the access address of the base application may be xxxx: / / b.abc.com / A-pice / quotation-offer, while the real address actually accessed by the front-end component may be xxxx: / / b1.abc.com / # / quotation / list. The two are poorly correlated, making it difficult to map the base application address to the real address of the sub-application.
[0039] In the scenario where there is no page with a fixed access address, the sub-application will send a cross-domain communication message to the base application. After receiving the message, the base application can generate a random code, register it in the global route, and generate the access address of the base application based on the random code. However, the access address of the base application generated at this time is temporarily generated locally, and the address cannot be copied and sent to others for access. For example, the access address of the base application generated in device A is xxxx: / / b.abc.com / ec12345. Through this access address, the real address xxxx can be accessed through the micro-frontend component in device A; / / b2.abc.com / quotation? id=111 to open the target web page. In device B, since there is no route for this temporary code, entering the above access address in the address bar of the base application will jump to the error page and the target web page cannot be opened.
[0040] In view of this, the embodiments of the present disclosure provide a page processing method, device, electronic device, readable storage medium and computer program product. The method includes: in response to receiving a cross-domain communication message, based on the target sub-application code included in the cross-domain communication message, determining a target routing record corresponding to the cross-domain communication message from a routing table; based on the target routing record, obtaining a first web page address; based on the first web page address, determining a target tag page associated with the cross-domain communication message; and based on the message type of the cross-domain communication message, processing the target tag page.
[0041] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security, and national security.
[0042] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0043] It should be noted that, unless it is explicitly stated that there is a sequence of execution between different operations shown in the flowchart in the embodiments of the present disclosure, or there is a sequence of execution between different operations in technical implementation, otherwise, the execution order of multiple operations may not be prioritized, and multiple operations may also be executed simultaneously.
[0044] Figure 1 The exemplary system architecture to which the page processing method and apparatus according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0045] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0046] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).
[0047] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0048] The server 105 may be a server that provides various services, such as a background management server that provides support for websites browsed by users using the terminal devices 101 , 102 , and 103 (only an example).
[0049] It should be noted that the page processing method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the page processing device provided in the embodiment of the present disclosure can generally be set in the server 105. The page processing method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the page processing device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Alternatively, the page processing method provided in the embodiment of the present disclosure can be executed by the terminal devices 101, 102, or 103, or can also be executed by other terminal devices different from the terminal devices 101, 102, or 103. Accordingly, the page processing device provided in the embodiment of the present disclosure can also be set in the terminal devices 101, 102, or 103, or can be set in other terminal devices different from the terminal devices 101, 102, or 103.
[0050] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0051] Figure 2 The flowchart of the page processing method according to the embodiment of the present disclosure is schematically shown.
[0052] like Figure 2 As shown, the method includes operations S201 to S204.
[0053] In operation S201 , in response to receiving a cross-domain communication message, based on a target sub-application code included in the cross-domain communication message, a target routing record corresponding to the cross-domain communication message is determined from a routing table.
[0054] In operation S202, a first webpage address is obtained based on the target routing record.
[0055] In operation S203, based on the first webpage address, a target tab page associated with the cross-domain communication message is determined.
[0056] In operation S204, based on the message type of the cross-domain communication message, the target tab page is processed.
[0057] According to an embodiment of the present disclosure, a cross-domain communication message may refer to an information carrier for communication between a sub-application and a base application in a micro-frontend framework. The sub-application that sends a cross-domain communication message may be a sub-application related to the current tab page. After the user clicks a button in any tab page, the sub-application related to the tab page may generate a cross-domain communication message based on the link information of the button and send the cross-domain communication message to the base application. Alternatively, as an optional implementation, the web page address entered by the user in the address bar of the base application may also be converted into a cross-domain communication message to be received by the base application. At this time, the cross-domain communication message may be generated directly by the base application.
[0058] According to an embodiment of the present disclosure, a routing table may be a collection of routing records pre-registered by a developer in a global routing. The routing table may include routing records formed based on each menu item in the menu tree, each menu item's respective menu sub-items at each level, and the link items included in the menu sub-items, such as the address of the details / edit page. Each routing record may include path parameter information such as an access path and access path parameters and the sub-application code of the menu item, menu sub-item or link item. The storage method of each routing record in the global routing is not limited here. For example, each routing record may be represented as an array, and the access path, access path parameters and other information included in the routing record may be used as elements in the array, and the sub-application code included in the routing record may be used as the array name of the array.
[0059] According to an embodiment of the present disclosure, the message content of the cross-domain communication message may include a sub-application code, an access path, access path parameters, a name of a tab page, and the like.
[0060] According to an embodiment of the present disclosure, the sub-application code may be a name preset by a developer for each menu item or menu sub-item. The multiple link items included in a menu item or menu sub-item may have the same sub-application code, but their respective access paths, access path parameters, tab pages and other information may be different. When determining the target routing record corresponding to the cross-domain communication message from the routing table, the target sub-application code may be used to match the sub-application codes in each routing record respectively. If only one routing record is matched, the routing record is the target routing record. In the case of matching multiple routing records, other contents included in the cross-domain communication message, such as access paths, access path parameters, etc., may also be used to continue matching the multiple routing records matched until the target routing record is obtained.
[0061] According to an embodiment of the present disclosure, the first web page address may refer to a real address related to the target sub-application, that is, the page of the target sub-application may be accessed through the first web page address.
[0062] According to an embodiment of the present disclosure, the target tab page may be a blank tab page obtained by creating a new tab, or may be an existing tab page obtained by matching.
[0063] According to an embodiment of the present disclosure, the message types of the cross-domain communication message may include types such as opening a tab page and closing a tab page.
[0064] According to an embodiment of the present disclosure, the web page address entered in the base application can be converted into a cross-domain communication message. Alternatively, the user clicks a button in any tab page, and the link corresponding to the button can be converted into a cross-domain communication message. The target routing record that matches the message content of the cross-domain communication message can be determined from the routing table, and then the first web page address, that is, the web page address actually used by the sub-application can be determined based on the target routing record and the target sub-application code included in the cross-domain communication message. Afterwards, the target tab page can be determined by creating a new page, matching, etc., and corresponding operations can be performed on the target tab page according to the message type of the cross-domain communication message. Through the routing table, it is possible to parse the cross-domain communication message to obtain the first web page address, which can at least partially overcome the routing distribution problem existing in the related art, thereby effectively improving the availability of the micro-frontend framework.
[0065] Reference below Figure 3 to Figure 6 , combined with specific embodiments Figure 2 The method shown is further explained.
[0066] Figure 3 A schematic diagram of a micro front-end framework according to an embodiment of the present disclosure is schematically shown.
[0067] like Figure 3 As shown, the micro-frontend framework can run in the browser client program of the terminal device. The main interface of the micro-frontend framework can be the interface of the base application 301. The interface of the base application 301 may include an address bar 302, a tab bar 303, a menu bar 304 and a tab page 305. When jumping to the tab page 305, the web page address can be displayed in the address bar 302 of the base application 301, or the user can jump to the tab page 305 by entering the web page address in the address bar 302. The tab bar 303 may include multiple tags, and each tag may have a corresponding tab page 305. The menu bar 304 may include multiple menu items, and by clicking on the menu items, the menu sub-items under the menu items can be displayed on the interface. The tab page 305 may include multiple buttons, each of which may be represented as a link item.
[0068] According to an embodiment of the present disclosure, during the initialization of the base application, the base application may utilize a menu permission system to generate a routing table and register the routing table in a global route. The menu permission system may be associated with the base application.
[0069] Figure 4 The flowchart of the method for generating a routing table according to an embodiment of the present disclosure is schematically shown.
[0070] like Figure 4 As shown, the method includes operations S401-S402.
[0071] In operation S401, the menu authority system interface is called to obtain a menu tree.
[0072] In operation S402, multiple sub-items included in the menu tree are registered in the global routing to obtain a routing table.
[0073] According to an embodiment of the present disclosure, by calling a menu authority system interface, a menu tree can be obtained from a menu authority system. The menu tree can be represented as a tree structure consisting of menu items and their sub-items, each of which can be represented as a menu item or a sub-item, and the edges between nodes can be represented as inclusion relationships between menu items or sub-items. Sub-items can include menu sub-items and link items.
[0074] According to an embodiment of the present disclosure, multiple sub-items included in the menu tree are registered in the global route, and obtaining the routing table can be traversing the menu tree to obtain path-related information included in the menu tree, and registering the path-related information in the global route to obtain the routing table. Specifically, the following operations may be included:
[0075] Respectively parse the web page addresses of the multiple sub-items to obtain the sub-application codes and path parameter information of the multiple sub-items; for each sub-item, register the sub-application code and path parameter information of the sub-item in the global route to obtain the routing record of the sub-item; and write the routing paths of the multiple sub-items into the initial routing table to obtain the routing table.
[0076] According to an embodiment of the present disclosure, the web page address of the sub-item may be a real address for accessing the sub-item. The path parameter information may include information such as the access path, the access path parameter, and the name of the tab page. Parsing the web page address of the sub-item may be splitting the web page address to obtain the sub-application code and the path parameter information. For example, the web page address of the sub-item may be xxxx: / / b2.abc.com / e-ui / quotation / list?id=111. When parsing the web page address, the web page address may be split into three parts, "b2.abc.com", "quotation / list", "e-ui" and "id=111", based on some specific symbols, such as "?", " / ", etc., wherein "b2.abc.com" may represent the domain name of the sub-item, "e-ui" may represent the sub-application code of the sub-item, "quotation / list" may represent the access path of the sub-item, and "id=111" may represent the access path parameter of the sub-item, the parameter name of the parameter is id, and the parameter value is 111. The name of the routing record of a sub-item may be a digest value of the webpage address of the sub-item.
[0077] According to an embodiment of the present disclosure, when different devices use the same base application, since they can access the same menu permission system, different devices can hold the same routing table. When the same address is entered in the same base application of different devices, the same routing table can be used to convert the address, so that different devices can open the same page based on the same address, which can effectively improve the availability of the micro front-end framework.
[0078] According to an embodiment of the present disclosure, the routing records in the routing table can save the relationship between the real domain name of each sub-item and the sub-application code of the sub-item. Therefore, after obtaining the cross-domain communication message, the first web page address can be spliced according to the sub-application code of the cross-domain communication message and the content of the routing record corresponding to the sub-application code.
[0079] According to an embodiment of the present disclosure, operation S202 may include the following operations:
[0080] Parse the target routing record to obtain the target domain name and target path parameter information; and obtain the first web page address based on the target domain name and target path parameter information.
[0081] According to an embodiment of the present disclosure, for example, the address of the base application represented by the cross-domain communication message can be represented as xxxx; / / b.abc.com / e-ui / quotation / list? id=||1, that is, the second web page address, from which the sub-application code can be obtained as "e-ui", the access path is "quotation / list", and the access path parameter is "id=111". The target routing record obtained by matching the above information can include the same access path and access path parameters, that is, the target path parameter information. In addition, the target routing record can also include the target domain name "b2.abc.com" of the sub-item. Based on the target domain name and the target path parameter information, the first web page address that can be spliced can be xxxx: / / b2.abc.com / quotation / list? id=111.
[0082] According to an embodiment of the present disclosure, operation S203 may include the following operations:
[0083] Performing a digest calculation on the first webpage address to obtain a digest value; and determining a target tag page based on the digest value.
[0084] According to an embodiment of the present disclosure, the digest calculation of the first webpage address may be performed by using various hash algorithms to convert the first webpage address into a string with a fixed length. For example, the hash algorithm may be an MD5 algorithm, and accordingly, the obtained digest value may be the MD5 value of the first webpage address.
[0085] According to an embodiment of the present disclosure, based on the existing tab pages in the tab bar of the base application, based on the summary value, determining the target tab page may include the case where the target tab page exists in the existing tab pages and the case where the target tab page does not exist in the existing tab pages. Therefore, when determining the target tab page, it can be determined first by matching whether the target tab page is an existing tab page.
[0086] According to an embodiment of the present disclosure, determining a target tag page based on a summary value may include the following operations:
[0087] The component names of at least one micro-frontend component corresponding to at least one tab page included in the tab bar are compared with the summary values to obtain comparison results; and when the comparison result indicates that the summary value is consistent with the component name of the first micro-frontend component, the tab page corresponding to the first micro-frontend component is determined to be the target tab page.
[0088] According to an embodiment of the present disclosure, when any micro-front-end component is generated, the summary value of the web page address actually used in the micro-front-end component can be used as the component name of the micro-front-end component. Thus, when matching, the summary value can be compared with the component name of each micro-front-end component to obtain a comparison result indicating whether the target tab page is an existing tab page. As an optional implementation, the micro-front-end component may not have a corresponding component name. In this case, a summary calculation can be performed on the web page address accessed in the micro-front-end component to obtain an address summary value, and the address summary value of the micro-front-end component can be compared with the summary value.
[0089] According to an embodiment of the present disclosure, when it is determined that the tab page corresponding to the first micro-frontend component is the target tab page, the target tab page can be processed accordingly according to the message type of the cross-domain communication message. Specifically, when the message type of the cross-domain communication message is an open tab type, the first micro-frontend component can be run, jump to the target tab page, and display the target page. It should be noted that the operation of running the first micro-frontend component and the operation of jumping to the target tab page can be executed synchronously or asynchronously in any order, which is not limited here.
[0090] According to an embodiment of the present disclosure, when the comparison result indicates that the summary value is inconsistent with the component name of at least one micro-front-end component, that is, when the comparison result indicates that the target tab page is a tab page that does not currently exist, the target tab page can be created based on the message content of the cross-domain communication message.
[0091] According to an embodiment of the present disclosure, the cross-domain communication message may carry a web page address that needs to be entered in the address bar of the base application, i.e., a second web page address. At this time, the target tab page may be created by directly entering the second web page address in the address bar of the base application.
[0092] According to an embodiment of the present disclosure, as an optional implementation, the message content of the cross-domain communication message may also carry path parameter information. Based on the message content of the cross-domain communication message, creating a target tag page may include the following operations:
[0093] Based on the preset domain name and the message content of the cross-domain communication message, a second web page address is generated; and based on the second web page address, a target tag page is created.
[0094] According to an embodiment of the present disclosure, creating a target tab page based on the second web page address may be creating a blank tab page in a tab bar, and inputting the second web page address in an address bar of the blank tab page.
[0095] According to an embodiment of the present disclosure, when the comparison result indicates that the target tab page is a tab page that does not currently exist, it may indicate that there is no micro front-end component corresponding to the target tab page in the base application, and when the target tab page is created, a corresponding micro front-end component may also be generated. Specifically, based on the message type of the cross-domain communication message, processing the target tab page may include the following operations:
[0096] The summary value is used as the component name, the first webpage address is used as the access address, and a second micro-frontend component is generated based on the component template; and the second micro-frontend component is registered to run the second micro-frontend component and open the target page in the target tab page.
[0097] According to an embodiment of the present disclosure, registering the second micro front-end component may be registering the second micro front-end component in a base application, so that the base application can jump and run the second micro front-end component through instructions, and after the second micro front-end component is run, it can open the target page by accessing the first web page address.
[0098] According to an embodiment of the present disclosure, when the base application is initialized, a routing table can be generated by looping through the menu tree. In the case where the message type of the cross-domain communication message is a close tag type, the first micro-frontend component can be closed to close the target tag page. Specifically, based on the routing table, the first web page address can be determined according to the message content of the cross-domain communication message, and the first web page address can be summarized and calculated to obtain a summary value, and the summary value can be used as a component name, and compared with at least one micro-frontend component to determine the first micro-frontend component from at least one micro-frontend component, and then the target tag page can be closed by closing the first micro-frontend component. At this time, the button that triggers the cross-domain communication message can be, for example, various buttons that indicate closing that exist in the page. In some embodiments, the base application may not directly close the target tag page, but may initialize the target tag page to obtain a blank tag page.
[0099] According to an embodiment of the present disclosure, as an optional implementation, when the base application receives a cross-domain communication message of a tag-closing type, its routing table may be in an invalid state, and at this time, the menu tree may be used to close the tag page.
[0100] Figure 5 The flowchart of a page processing method according to another embodiment of the present disclosure is schematically shown.
[0101] like Figure 5 As shown, the method includes operations S501 to S508.
[0102] In operation S501 , the base application receives a cross-domain communication message.
[0103] In operation S502, it is determined whether there is a sub-item corresponding to the cross-domain communication message in the menu tree of the base application. If it is determined that there is a sub-item corresponding to the cross-domain communication message in the menu tree, operation S503 is performed. If it is determined that there is a sub-item corresponding to the cross-domain communication message in the menu tree, the page processing flow is ended.
[0104] In operation S503, it is determined whether the sub-item is configured with a corresponding routing record name. If it is determined that the sub-item is configured with a corresponding routing record name, operation S504 is performed. If it is determined that the sub-item is not configured with a corresponding routing record name, operation S505 is performed.
[0105] In operation S504, it is determined whether there is a first microservice component corresponding to the routing record name in at least one microservice component. If it is determined that there is a first microservice component corresponding to the routing record name, operation S506 is performed. If it is determined that there is no first microservice component corresponding to the routing record name, operation S507 is performed.
[0106] In operation S505, a summary value is generated based on the webpage address of the sub-item, and the summary value is used as the routing record name. After operation S505 is completed, operation S504 is performed.
[0107] In operation S506, the first micro front-end component is closed to close the target tab page.
[0108] In operation S507, at least one digest value is generated based on the web page address of each of the at least one microservice components, and the at least one digest value is used as the component name of each of the at least one microservice components.
[0109] In operation S508, it is determined whether there is a first microservice component corresponding to the routing record name in at least one microservice component. If it is determined that there is a first microservice component corresponding to the routing record name, operation S506 is performed. If it is determined that there is no first microservice component corresponding to the routing record name, the page processing flow ends.
[0110] According to an embodiment of the present disclosure, it is possible to determine whether there is a sub-item corresponding to the cross-domain communication message by comparing the web page address of each sub-item in the menu tree with the web page address included in the cross-domain communication information. In the case where it is determined that there is no sub-item corresponding to the cross-domain communication message, it can be considered that the sending target of the cross-domain communication message is incorrect, and the page processing flow can be terminated at this time.
[0111] According to an embodiment of the present disclosure, in operation S503, when it is determined that the sub-item is not configured with a corresponding routing record name, it can be considered that the routing table is invalid, or the information in the routing table is not updated in time. At this time, a new routing record name can be determined based on the web page address of each sub-item.
[0112] According to an embodiment of the present disclosure, in operation S504, when it is determined that there is no first microservice component corresponding to the routing record name, it can be considered that the name of the micro-front-end component is invalid or has not been updated in time. At this time, a new component name can be determined based on the web page address of at least one micro-front-end component.
[0113] According to an embodiment of the present disclosure, in operation S508, if it is determined that there is no first microservice component corresponding to the routing record name, it can be considered that the page processing flow is executed incorrectly, and the page processing flow can be terminated. In some embodiments, an alarm information can also be provided to the operation and maintenance personnel.
[0114] According to an embodiment of the present disclosure, when the message type of the cross-domain communication message is an open tag type, as an optional implementation, in order to reduce the pressure on bandwidth and computing resources, the access rights of the cross-domain communication message can also be verified before parsing the cross-domain communication message.
[0115] Figure 6 The following schematically shows a flow chart of a page processing method according to another embodiment of the present disclosure.
[0116] like Figure 6 As shown, the method includes operations S601 to S606.
[0117] In operation S601 , the base application receives a cross-domain communication message.
[0118] In operation S602, it is determined whether the cross-domain communication message has access rights. If it is determined that the message does not have access rights, operation S603 is performed. If it is determined that the message has access rights, operation S604 is performed.
[0119] In operation S603, jump to a preset page.
[0120] In operation S604, a digest value is generated based on the message content of the cross-domain communication message.
[0121] In operation S605 , a first micro front-end component is determined using the summary value as a component name.
[0122] In operation S606, the first micro front-end component is run, the target tab page is jumped to, and the target page is displayed.
[0123] According to an embodiment of the present disclosure, a routing table can be used to verify access rights based on the message content of a cross-domain communication message. Specifically, the message content of the cross-domain communication message can be matched with multiple routing records included in the routing table in sequence to obtain a matching result; and when the matching result indicates that the message content of the cross-domain communication message matches the target routing record in the multiple routing records, it is determined that the access right is granted.
[0124] According to an embodiment of the present disclosure, the message content of the cross-domain communication message matches the routing record, which can be that the sub-application code, access path, access path parameters and other information included in the cross-domain communication message match the sub-application code, access path, access path parameters and other information in the routing record. That is, the web page indicated to be opened or closed by the cross-domain communication information, and the address has been registered in the global routing and added to the routing table.
[0125] According to an embodiment of the present disclosure, when the matching result indicates that the message content of the cross-domain communication message does not match multiple routing records, it can be determined that the access right is not available. When it is determined that the access right is not available, the preset page can be opened in the current tab page, or a blank new tab page can be jumped to, and the preset page can be opened in the tab page. The preset page can be a preset page that can represent an error code. For example, the error at this time is that the address of the web page to be accessed is not registered in the route, that is, the web page address does not exist, and the corresponding error code can be 404, and accordingly, the preset page opened can be a page representing the error code 404.
[0126] Figure 7 The block diagram of a page processing device according to an embodiment of the present disclosure is schematically shown.
[0127] like Figure 7 As shown, the page processing device 700 includes a first determination module 710 , a first processing module 720 , a second determination module 730 and a second processing module 740 .
[0128] The first determination module 710 is configured to, in response to receiving a cross-domain communication message, determine a target routing record corresponding to the cross-domain communication message from a routing table based on a target sub-application code included in the cross-domain communication message.
[0129] The first processing module 720 is used to obtain a first webpage address based on the target routing record.
[0130] The second determination module 730 is used to determine a target tag page associated with the cross-domain communication message based on the first web page address.
[0131] The second processing module 740 is used to process the target tab page based on the message type of the cross-domain communication message.
[0132] According to an embodiment of the present disclosure, the second determining module 730 includes a first determining unit and a second determining unit.
[0133] The first determining unit is used to perform digest calculation on the first webpage address to obtain a digest value.
[0134] The second determining unit is used to determine a target tag page based on the summary value.
[0135] According to an embodiment of the present disclosure, the second determining unit includes a first determining subunit and a second determining subunit.
[0136] The first determination subunit is used to compare the component name of at least one micro-frontend component corresponding to at least one tab page included in the tab bar with the summary value to obtain a comparison result.
[0137] The second determining subunit is used to determine the tag page corresponding to the first micro front-end component as the target tag page when the comparison result indicates that the summary value is consistent with the component name of the first micro front-end component.
[0138] According to an embodiment of the present disclosure, the message type of the cross-domain communication message includes an open tag type.
[0139] According to an embodiment of the present disclosure, the second processing module 740 includes a first processing unit.
[0140] The first processing unit is used to run the first micro front-end component, jump to the target tag page, and display the target page when the message type of the cross-domain communication message is an open tag type.
[0141] According to an embodiment of the present disclosure, the page processing device 700 further includes a creation module.
[0142] A creation module is used to create a target tag page based on the message content of the cross-domain communication message when the comparison result indicates that the summary value is inconsistent with the component name of at least one micro-frontend component.
[0143] According to an embodiment of the present disclosure, the second processing module 740 includes a second processing unit and a third processing unit.
[0144] The second processing unit is used to generate a second micro front-end component based on the component template, using the summary value as the component name and the first webpage address as the access address.
[0145] The third processing unit is used to register the second micro front-end component to run the second micro front-end component and open the target page in the target tab page.
[0146] According to an embodiment of the present disclosure, the creation module includes a first creation unit and a second creation unit.
[0147] The first creation unit is used to generate a second web page address based on a preset domain name and a message content of the cross-domain communication message.
[0148] The second creating unit is used to create a target tag page based on the second web page address.
[0149] According to an embodiment of the present disclosure, the message type of the cross-domain communication message includes a close tag type.
[0150] According to an embodiment of the present disclosure, the second processing module 740 includes a fourth processing unit.
[0151] The fourth processing unit is used to close the first micro front-end component to close the target tab page when the message type of the cross-domain communication message is a close tag type.
[0152] According to an embodiment of the present disclosure, the page processing device 700 further includes a verification module and a third determination module.
[0153] The verification module is used to, in response to receiving a cross-domain communication message, use a routing table to verify access rights based on the message content of the cross-domain communication message.
[0154] The third determination module is used to determine the target routing record corresponding to the cross-domain communication message from the routing table based on the target sub-application code included in the cross-domain communication message when it is determined that the access right is granted.
[0155] According to an embodiment of the present disclosure, the verification module includes a first verification unit and a second verification unit.
[0156] The first verification unit is used to match the message content of the cross-domain communication message with the multiple routing records included in the routing table in sequence to obtain a matching result.
[0157] The second verification unit is used to determine that the access right is granted when the matching result indicates that the message content of the cross-domain communication message matches the target routing record in the plurality of routing records.
[0158] According to an embodiment of the present disclosure, the page processing device 700 further includes a fourth determining module and a third processing module.
[0159] The fourth determination module is used to determine that the access right is not granted when the matching result indicates that the message content of the cross-domain communication message does not match the multiple routing records.
[0160] The third processing module is used to open a preset page in the current tab page when it is determined that the user does not have the access permission.
[0161] According to an embodiment of the present disclosure, the first processing module 720 includes a fourth processing unit and a fifth processing unit.
[0162] The fourth processing unit is used to parse the target routing record to obtain the target domain name and target path parameter information.
[0163] The fifth processing unit is used to obtain the first web page address based on the target domain name and the target path parameter information.
[0164] According to an embodiment of the present disclosure, the page processing device 700 further includes a calling module and a registration module.
[0165] The calling module is used to call the menu permission system interface to obtain the menu tree.
[0166] The registration module is used to register multiple sub-items included in the menu tree in the global route to obtain a routing table.
[0167] According to an embodiment of the present disclosure, the registration module includes a first registration unit, a second registration unit and a third registration unit.
[0168] The first registration unit is used to parse the web page addresses of the multiple sub-items respectively to obtain the sub-application codes and path parameter information of the multiple sub-items.
[0169] The second registration unit is used to register the sub-application code and path parameter information of each sub-item in the global route to obtain the route record of the sub-item.
[0170] The third registration unit is used to write the routing paths of the multiple sub-items into the initial routing table to obtain the routing table.
[0171] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0172] For example, any of the first determination module 710, the first processing module 720, the second determination module 730 and the second processing module 740 can be combined in one module / unit / subunit for implementation, or any of the modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least part of the functions of one or more modules / units / subunits in these modules / units / subunits can be combined with at least part of the functions of other modules / units / subunits and implemented in one module / unit / subunit. According to an embodiment of the present disclosure, at least one of the first determination module 710, the first processing module 720, the second determination module 730 and the second processing module 740 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by a suitable combination of any of them. Alternatively, at least one of the first determination module 710 , the first processing module 720 , the second determination module 730 , and the second processing module 740 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0173] It should be noted that the page processing device part in the embodiment of the present disclosure corresponds to the page processing method part in the embodiment of the present disclosure. The description of the page processing device part specifically refers to the page processing method part, which will not be repeated here.
[0174] Figure 8 A block diagram of an electronic device suitable for implementing a page processing method according to an embodiment of the present disclosure is schematically shown. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0175] like Figure 8As shown, the computer electronic device 800 according to the embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0176] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0177] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the input / output (I / O) interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.
[0178] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0179] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0180] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0181] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 802 and / or the RAM 803 described above and / or one or more memories other than the ROM 802 and the RAM 803 .
[0182] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the page processing method provided by the embodiment of the present disclosure.
[0183] When the computer program is executed by the processor 801, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0184] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0185] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0186] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0187] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A page processing method, comprising: In response to receiving a cross-domain communication message, determining a target routing record corresponding to the cross-domain communication message from a routing table based on a target sub-application code included in the cross-domain communication message; Based on the target routing record, obtaining a first webpage address; Based on the first web page address, determining a target tab page associated with the cross-domain communication message; as well as Based on the message type of the cross-domain communication message, the target tab page is processed.
2. The method according to claim 1, wherein: The determining, based on the first webpage address, a target tag page associated with the cross-domain communication message includes: Performing digest calculation on the first webpage address to obtain a digest value; and Based on the summary value, the target tag page is determined.
3. The method according to claim 2, wherein: The step of determining the target tag page based on the summary value includes: Using the component name of at least one micro-frontend component corresponding to each of at least one tab page included in the tab bar, respectively, to compare with the summary value to obtain a comparison result; and When the comparison result indicates that the summary value is consistent with the component name of the first micro front-end component, the tab page corresponding to the first micro front-end component is determined as the target tab page.
4. The method according to claim 3, wherein: The message type of the cross-domain communication message includes an open tag type; The processing of the target tab page based on the message type of the cross-domain communication message includes: When the message type of the cross-domain communication message is the open tag type, the first micro front-end component is run, the target tag page is jumped to, and the target page is displayed.
5. The method according to claim 4, further comprising: When the comparison result indicates that the summary value is inconsistent with the component name of the at least one micro-frontend component, the target tag page is created based on the message content of the cross-domain communication message.
6. The method according to claim 5, wherein: The processing of the target tab page based on the message type of the cross-domain communication message includes: Using the summary value as the component name and the first webpage address as the access address, generating a second micro-frontend component based on the component template; and The second micro front-end component is registered to run the second micro front-end component, and the target page is opened in the target tab page.
7. The method according to claim 5, wherein: The creating the target tag page based on the message content of the cross-domain communication message includes: generating a second webpage address based on a preset domain name and the message content of the cross-domain communication message; and Based on the second web page address, create the target tag page.
8. The method according to claim 3, wherein: The message type of the cross-domain communication message includes a close tag type; The processing of the target tab page based on the message type of the cross-domain communication message includes: When the message type of the cross-domain communication message is the close tag type, the first micro front-end component is closed to close the target tag page.
9. The method according to claim 1, further comprising: In response to receiving the cross-domain communication message, using a routing table to perform access permission verification based on message content of the cross-domain communication message; as well as In the case where it is determined that the access right is granted, based on the target sub-application code included in the cross-domain communication message, a target routing record corresponding to the cross-domain communication message is determined from a routing table.
10. The method according to claim 9, wherein: The utilizing the routing table to verify access rights based on the message content of the cross-domain communication message includes: Matching the message content of the cross-domain communication message with the multiple routing records included in the routing table in sequence to obtain a matching result; and When the matching result indicates that the message content of the cross-domain communication message matches the target routing record in the plurality of routing records, it is determined that the access right is granted.
11. The method according to claim 10, further comprising: If the matching result indicates that the message content of the cross-domain communication message does not match the multiple routing records, determining that the access right is not granted; as well as If you are sure that you do not have access permissions, open the preset page in the current tab.
12. The method according to claim 1, wherein: The obtaining a first webpage address based on the target routing record includes: Parsing the target routing record to obtain target domain name and target path parameter information; and Based on the target domain name and the target path parameter information, the first web page address is obtained.
13. The method according to any one of claims 1 to 12, further comprising: Call the menu permission system interface to get the menu tree; as well as The plurality of sub-items included in the menu tree are registered in the global routing to obtain the routing table.
14. The method according to claim 13, wherein: The registering of the plurality of sub-items included in the menu tree in the global routing to obtain the routing table includes: Respectively parsing the web page addresses of the plurality of sub-items to obtain the sub-application codes and path parameter information of the plurality of sub-items; For each sub-item, register the sub-application code and path parameter information of the sub-item in the global route to obtain the route record of the sub-item; and The routing paths of the respective sub-items are written into the initial routing table to obtain the routing table.
15. A page processing device, comprising: A first determination module, configured to, in response to receiving a cross-domain communication message, determine a target routing record corresponding to the cross-domain communication message from a routing table based on a target sub-application code included in the cross-domain communication message; A first processing module, configured to obtain a first webpage address based on the target routing record; A second determination module, configured to determine a target tag page associated with the cross-domain communication message based on the first web page address; as well as The second processing module is used to process the target tab page based on the message type of the cross-domain communication message.
16. An electronic device comprising: one or more processors; a memory for storing one or more instructions, Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 14.
17. A computer-readable storage medium having executable instructions stored thereon, wherein when the executable instructions are executed by a processor, the processor is enabled to implement the method according to any one of claims 1 to 14.
18. A computer program product, comprising computer executable instructions, which are used to implement the method of any one of claims 1 to 14 when executed.
