Webpage switching method and device, equipment, storage medium and program product
By integrating multiple business systems in a single-page web application and resetting the browser history stack and global state data, the resource waste and user experience problems during web page switching between different business systems are solved, and efficient and low-cost business system switching is achieved.
Patent Information
- Application Number
- CN202411825252.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art has problems such as wasted resources, poor user experience and high session cost when switching web pages between different business systems.
Single-page Web application (SPA) is used to integrate multiple business systems, and web page switching between business systems is realized by recording the reset of business system identification and global status data in the browser history stack.
It improves the efficiency and user experience of web switching, reduces R&D and deployment costs, and avoids the complexity of session connection.
Smart Images

Figure CN119691308A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a web page switching method, device, equipment, storage medium and program product. Background Art
[0002] A business process often requires related operations from different parties to complete, and business personnel from each party often need to log in to different business systems to complete the corresponding business operations to ensure the normal advancement of the business process. Since business personnel from each party usually have multiple business systems, when business personnel log in to different business systems to complete business operations, it often involves switching web pages between different business systems. Therefore, how to achieve the correct switching of web pages between different business systems has become a hot research issue. Summary of the invention
[0003] The embodiments of the present application provide a web page switching method, device, electronic device, computer-readable storage medium and computer program product, which can improve the web page switching effect.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application provides a web page switching method, including:
[0006] Displaying a first webpage belonging to a first business system, wherein the first webpage is adapted to the first account authority;
[0007] In response to the first switching instruction, the first webpage is switched to a second webpage belonging to a second business system, the URL of the second webpage includes a business identifier of the second business system, and the second webpage is adapted to the first account authority;
[0008] In response to a first rollback instruction instructing to roll back to a third webpage, determining a service identifier in the URL of the third webpage, and determining a first time interval between a refresh time point of the third webpage and a triggering time point of the first rollback instruction;
[0009] When the business identifier in the URL of the third webpage is different from the business identifier of the second business system and the first time interval reaches the time interval threshold, the third webpage is determined to be the first webpage, and based on the first webpage variable of the first webpage, the second webpage is switched to the refreshed first webpage.
[0010] The embodiment of the present application also provides a web page switching device, including:
[0011] A display module, configured to display a first webpage belonging to a first business system, wherein the first webpage is adapted to the first account authority;
[0012] A first switching module, configured to switch the first webpage to a second webpage belonging to a second business system in response to a first switching instruction, wherein the URL of the second webpage includes a business identifier of the second business system, and the second webpage is adapted to the first account authority;
[0013] a determination module, configured to determine, in response to a first rollback instruction instructing to roll back to a third webpage, a service identifier in the URL of the third webpage, and determine a first time interval between a refresh time point of the third webpage and a triggering time point of the first rollback instruction;
[0014] The second switching module is used to determine that the third web page is the first web page when the business identifier in the URL of the third web page is different from the business identifier of the second business system and the first time interval reaches the time interval threshold, and switch the second web page to the refreshed first web page based on the first web page variable of the first web page.
[0015] The present application also provides an electronic device, including:
[0016] A memory for storing computer executable instructions;
[0017] The processor is used to implement the web page switching method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.
[0018] The embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the web page switching method provided in the embodiment of the present application is implemented.
[0019] The embodiment of the present application further provides a computer program product, including computer executable instructions or a computer program, and when the computer executable instructions or the computer program are executed by a processor, the web page switching method provided in the embodiment of the present application is implemented.
[0020] The embodiments of the present application have the following beneficial effects:
[0021] Applying the above-mentioned embodiment of the present application, in response to a first switching instruction, a first web page belonging to a first business system and adapted to the first account authority is switched to a second web page belonging to a second business system and adapted to the first account authority; when a first fallback instruction instructing to fall back to a third web page is received, the business identifier in the URL of the third web page is determined, and the first time interval between the refresh time point of the third web page and the triggering time point of the first fallback instruction is determined, so that when the business identifier in the URL of the third web page is different from the business identifier of the second business system and the first time interval reaches the time interval threshold, based on the first web page variable, the second web page is switched to the refreshed first web page.
[0022] Here, 1) the first webpage of the first business system and the second webpage of the second business system are both adapted to the first account authority. In this way, the business personnel can support their business operations in different business systems without having to log in to different business systems separately, thereby improving the business processing efficiency of the business personnel.
[0023] 2) The URL of the second webpage includes the business identifier of the second business system, that is, the URL of the webpage includes the identifier of the business system to which the webpage belongs. Therefore, after the first webpage is switched to the second webpage, in response to the first fallback instruction, the business identifier in the URL of the third webpage is compared with the business identifier of the second business system. If the business identifier in the URL of the third webpage is different from the business identifier of the second business system, the third webpage is determined to be the first webpage, that is, this webpage fallback (that is, webpage switching) is a webpage switch between different business systems. Based on this, when the business identifier in the URL of the third webpage is different from the business identifier of the second business system and the first time interval reaches the time interval threshold, based on the first webpage variable, the second webpage is switched to the refreshed first webpage, thereby achieving the correct switching from the second webpage of the second business system back to the first webpage of the first business system before the webpage switching, and based on the first webpage variable, the refresh of the first webpage after the webpage fallback is achieved. In this way, not only the correct switching of webpages between different business systems is guaranteed, but also the correct refreshing of the webpage after the fallback is guaranteed, thereby improving the webpage switching effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a schematic diagram of an application mode of the web page switching method provided in an embodiment of the present application;
[0025] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0026] Figure 3A This is a schematic diagram of a first process of a web page switching method provided in an embodiment of the present application;
[0027] Figure 3B is a second flow chart of the web page switching method provided in an embodiment of the present application;
[0028] Figure 4 is a schematic diagram of switching of a business system provided in an embodiment of the present application;
[0029] Figure 5 This is a third flow chart of the web page switching method provided in an embodiment of the present application.
[0030] It should be noted that the above-mentioned “first” and “second” are only used to distinguish different solutions, and do not represent the degree of superiority or inferiority of the solutions or the priority in the implementation process. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0032] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0033] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0034] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the functions of the module or unit.
[0035] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0036] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.
[0037] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0038] 1) Client: An application running in an electronic device to provide various services, such as a browser client.
[0039] 2) In response to: used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.
[0040] 3) Single Page Web Application (SPA): It is an application with only one web page. It is a web application that loads a single HTML page and dynamically updates the page when the user interacts with the application.
[0041] 4) Management system end (Admin, A end): the business system used by the administrator.
[0042] 5) Business system end (Business, B end): usually a business system used by an enterprise, merchant or organization for work or business purposes.
[0043] 6) Consumer or Client (C-end): Business system usually used by consumers, individual users or end users.
[0044] 7) Project space: An organizational dimension that can be understood as an organizational dimension such as a sub-unit or a department.
[0045] 8) Uniform Resource Locator (URL): A string of characters used to specify the location of a resource on the Internet, also known as a URL. A URL usually includes the protocol used to locate the resource (such as HTTP or HTTPS), the location of the network resource (such as a domain name or IP address), and the path of the resource itself.
[0046] In the related technology, multiple sets of front-end business systems are made for different terminals (such as terminal A, terminal B, and terminal C). When a user with multi-terminal permissions needs to switch systems, a hyperlink jump or redirection refreshes the web page. However, there are the following problems:
[0047] Problem (1) Multiple sets of web front-end project source codes are used to deploy multiple sets of front-end business systems. The reusability of web pages and components is low, and there is a waste of deployment resources. Specifically, different front-end business systems are divided for different ends, such as management end systems, portal end systems, etc. In terms of development, multiple sets of front-end business systems are developed separately, and similar functions will be repeatedly developed, such as system layout frameworks, menus and other common web page blocks. Multiple sets of front-end business systems are deployed separately, and for front-end business systems that require domain names, multiple domain names need to be applied for.
[0048] Problem (2) When switching, the front-end business system jumps, which gives a strong sense of disconnection; when redirecting and refreshing the web page, the white screen lasts for a long time, which leads to a poor user experience. Specifically, whether it is a hyperlink jump or a redirection and refreshing of the web page, all static resources of the target front-end business system will be reloaded, resulting in many network requests and long waiting time. Moreover, if the front-end business system jumps, it gives the user a sense of disconnection, which results in a poor overall user experience.
[0049] Problem (3) The front-end business system jump requires login authorization, such as single sign-on and other shared session technologies. Specifically, because multiple front-end business systems are deployed, switching front-end business systems, jumping or redirecting refreshes all involve session login. If the session is not opened, login will be required during the initial switch; if the session is opened, it will require a certain amount of cost for the research and development of session sharing, which is not good for user experience and cost.
[0050] The embodiments of the present application provide a web page switching method, device, electronic device, computer-readable storage medium and computer program product, which can improve the web page switching effect. Next, based on the above description of the nouns and terms involved in the embodiments of the present application, the embodiments of the present application are described in detail.
[0051] See also Figure 1 , Figure 1 Schematic diagram of the application mode of the webpage switching method provided in the embodiment of the present application. To realize supporting an exemplary application, Figure 1 The illustrated 100 includes: a server 200, a network 300, and a terminal 400. The terminal 400 is connected to the server 200 via the network 300. The network 300 may be a wide area network or a local area network, or a combination of the two, and uses a wireless or wired link to achieve data transmission.
[0052] Here, terminal 400 (for example, running a browser client) sends a first data acquisition request for a first webpage of a first business system to server 200, and the first webpage is adapted to the first account authority; server 200 receives the first data acquisition request sent by terminal 400; in response to the first data acquisition request, returns the first webpage data of the first webpage to terminal 400; terminal 400 receives the first webpage data returned by server 200; renders based on the first webpage data, and displays the rendered first webpage; in response to the first webpage switching instruction, sends a second data acquisition request for a second webpage of a second business system to server 200, and the second webpage is adapted to the first account authority; server 200 receives the second data acquisition request sent by terminal 400; in response to the second data acquisition The server 200 receives the second web page data returned by the server 200; renders the second web page based on the web page data of the second web page, and displays the rendered second web page, wherein the URL of the second web page includes the business identifier of the second business system; in response to a first fallback instruction indicating a fallback to a third web page, determines the business identifier in the URL of the third web page, and determines a first time interval between a refresh time point of the third web page and a trigger time point of the first fallback instruction; when the business identifier in the URL of the third web page is different from the business identifier of the second business system and the first time interval reaches a time interval threshold, determines that the third web page is the first web page, and switches the second web page to the refreshed first web page based on the first web page variable of the first web page.
[0053] In some embodiments, the webpage switching method provided in the embodiment of the present application is implemented by an electronic device, for example, it can be implemented by a terminal alone, it can also be implemented by a server alone, or it can be implemented by a terminal and a server in collaboration. The electronic device can be various types of terminals or servers. Among them, the server (such as server 200) can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal (such as terminal 400) can be a laptop, a tablet computer, a desktop computer, a smart phone, an intelligent voice interaction device (such as an intelligent speaker), a smart home appliance (such as a smart TV), a smart watch, a vehicle-mounted terminal, a wearable device, a virtual reality (Virtual Reality, VR) device, an aircraft, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and the embodiment of the present application does not limit this.
[0054] In some embodiments, the terminal or server can implement the webpage switching method provided by the embodiment of the present application by running various computer executable instructions or computer programs. For example, computer executable instructions can be commands, machine instructions or software instructions at the microprogram level. The computer program can be a native program or software module in the operating system; it can be a local (Native) application (Application, APP), that is, a program that needs to be installed in the operating system to run, such as a browser APP; it can also be a small program that can be embedded in any APP, that is, a program that can be run only by downloading it to the browser environment. In short, the above-mentioned computer executable instructions can be instructions in any form, and the above-mentioned computer program can be an application, module or plug-in in any form.
[0055] The following describes an electronic device for implementing a web page switching method provided by an embodiment of the present application. Figure 2 , Figure 2 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. The electronic device 500 provided in the embodiment of the present application can be a terminal or a server. Figure 2 As shown, the electronic device 500 includes: at least one processor 510, a memory 550, at least one network interface 520 and a user interface 530. The various components in the electronic device 500 are coupled together through a bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 540 is not used in the following examples. Figure 2 Various buses are labeled as bus system 540 .
[0056] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0057] The user interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0058] The memory 550 may be removable, non-removable, or a combination thereof. The memory 550 may include one or more storage devices physically located away from the processor 510. The memory 550 includes a volatile memory or a non-volatile memory, and may also include both a volatile memory and a non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.
[0059] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0060] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0061] A network communication module 552, used to reach other electronic devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;
[0062] a presentation module 553 for enabling presentation of information via one or more output devices 531 (e.g., display screen, speaker, etc.) associated with the user interface 530 (e.g., a user interface for operating peripherals and displaying content and information);
[0063] The input processing module 554 is used to detect one or more user inputs or interactions from one of the one or more input devices 532 and translate the detected inputs or interactions.
[0064] In some embodiments, the webpage switching device provided in the embodiments of the present application can be implemented in a software manner. Figure 2 A web page switching device 555 stored in a memory 550 is shown, which may be software in the form of a program or plug-in, including the following software modules: a display module 5551, a first switching module 5552, a determination module 5553, and a second switching module 5554. These modules are logical, and therefore may be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
[0065] The webpage switching method provided by the embodiment of the present application is described below. As mentioned above, the webpage switching method provided by the embodiment of the present application is implemented by an electronic device, for example, it can be implemented by a server or a terminal alone, or by a server and a terminal in collaboration. Therefore, the execution subject of each step will not be repeatedly described below. Figure 3A , Figure 3A : is a flow chart of a web page switching method provided in an embodiment of the present application. The web page switching method provided in an embodiment of the present application includes:
[0066] Step 101: Display a first webpage belonging to a first business system.
[0067] Among them, the first business system has a first business identifier, and the first webpage is adapted to the first account authority.
[0068] Here, the business system (such as the first business system and the second business system) is a module with relatively independent business functions. For example, public functions such as user session, account login, and authentication are classified as a relatively independent business system, and other specific businesses are implemented in independent business systems, such as the functional modules related to the bank fund system are classified as a business system. That is, the business system in the embodiment of the present application can be laid out and developed according to demand, not limited to a specific end (such as end A), for example, the corresponding business system can also be developed according to dimensions such as project space, organization, and business needs, so that the embodiment of the present application can support complex and diverse business scenarios.
[0069] For each business system, a business system includes at least one web page, and each web page is used to support part of the business operations of the corresponding business system. In actual applications, it is possible to support switching between different web pages in the same business system, and it is also possible to support switching between different web pages in different business systems. For switching between different web pages in the same business system, it can be understood that web page switching does not involve switching of the business system; for switching between different web pages in different business systems, it can be understood that web page switching involves switching of the business system.
[0070] The first business system and the second business system involved in the embodiment of the present application are integrated in a web application, and the web application is logged in with a first account (such as a user's account). Therefore, if the user needs to use the first business system, a web page opening instruction for the first business system can be triggered. Then, in response to the web page opening instruction, according to the first account authority of the first account, a first web page belonging to the first business system and adapted to the first account authority is displayed, and the first web page can be used to support business operations of the first account authority. Here, the first web page can be any web page in the first business system. For example, when the user enters the first business system from other business systems different from the first business system, the first web page can be a pre-set default web page belonging to the first business system. When the user is already in the system web page of the first business system, the first web page can be the web page indicated by the web page opening instruction triggered by the user on the system web page.
[0071] In actual applications, the web application can be a single web application (i.e., a single-page web application), which uses a set of project source code to deploy the multiple business systems, and different business systems can achieve high reusability (such as reuse of components, web pages, etc.), reducing R&D costs and deployment costs. For example, the multiple business systems can include business systems used by end A, end B, and end C, and the accounts of different ends have different permissions in the business system. According to the account of the user logging into the single-page web application, the web page of the business system that is compatible with the user's account is displayed to the user.
[0072] Step 102: In response to a first switching instruction, the first webpage is switched to a second webpage belonging to a second business system.
[0073] The URL of the second webpage includes a business identifier of a second business system, the second business system is different from the first business system, and the second webpage is adapted to the first account authority.
[0074] Here, the first switching instruction may be triggered based on a switching control, for example, see Figure 4 , Figure 4 This is a schematic diagram of the switching of the business system provided by the embodiment of the present application. Here, in the first webpage of the first business system, a switching control of the second business system can be displayed; in response to the trigger operation on the switching control, a first switching instruction is received; in response to the first switching instruction, the first webpage is switched to the second webpage of the second business system. Since the web application logs in the first account "Zhang", the first webpage and the second webpage are both adapted to the first account authority of the first account.
[0075] In some embodiments, the first business system and the second business system are integrated into a web application. The web application is logged in with a first account. The first account corresponds to the first account authority. Therefore, the first web page is used to support business operations with the first account authority, and the second web page is also used to support business operations with the first account authority.
[0076] For example, after a user logs in to a web application through a first account, if the user needs to open the first business system, the first webpage of the first business system that is compatible with the first account's permissions is determined according to the first account's permissions, thereby supporting the user to perform business operations related to the first account's permissions in the first webpage. It should be noted that the same account (such as the first account) can have operation permissions for multiple business systems, for example, a user belongs to multiple project spaces at the same time (a project space can correspond to a project business system), and has operation permissions for the management end A (the management end also has a management end business system). In this way, when the first webpage of the first business system is displayed, the first webpage of the first business system that is compatible with the first account is displayed, and the first webpage is used to support business operations of the first account's permissions. When the first webpage of the first business system is switched to the second webpage of the second business system, the first webpage is switched to the second webpage of the second business system that is compatible with the first account, and the second webpage is used to support business operations of the permissions of the first account. In this way, when a user switches webpages between different business systems, he only needs to log in once, without multiple account logins or logouts, which improves the user experience.
[0077] In some embodiments, the first account authority corresponds to the first account. After the second webpage is switched to the refreshed first webpage, the following operations may be performed: in response to switching from the first account to the second account, the first webpage is switched to the fifth webpage belonging to the first business system, and the fifth webpage is adapted to the second account authority of the second account. Here, the account logged in by the web application can be switched. When the logged-in account is switched from the first account to the second account, the refreshed first webpage also needs to be switched to the fifth webpage belonging to the first business system. The fifth webpage is adapted to the second account authority of the second account, and the fifth webpage supports business operations of the second account authority. It should be noted that the first webpage and the fifth webpage are webpages belonging to the same URL. If the first account authority and the second account authority are different, then the business operations executable in the first webpage and the business operations executable in the fifth webpage are different. In this way, by setting corresponding account permissions for different accounts, web pages that support different business operations can be provided for different account permissions. There is no need to develop and deploy corresponding business systems for different roles (i.e. corresponding to different account permissions), which improves the efficiency of research and development and deployment and reduces the cost of research and development and deployment. Since corresponding functions can be set for different account permissions from the full range of business system functions, flexibility is increased, and business systems can be added later according to needs (for example, the need to add other different accounts).
[0078] In some embodiments, after a web page is displayed, the business identifier of the business system to which the web page belongs is added to the web address (i.e., URL) of the web page. Therefore, here, after the first web page is switched to the second web page, the business identifier of the second business system is added to the web address of the second web page. In this way, by adding the business identifier of the business system to which the current web page belongs to the web address, it is possible to clearly understand the business system corresponding to the web page of each web address, so that when the web page switching involves the business system switching, the correct switching of the business system and the web page is guaranteed; at the same time, by adding the business identifier of the business system to which the web page belongs to the web address (i.e., URL) of the web page, the business identifier of the business system can be stored in the browser's history stack along with the change of the web address, so as to facilitate the quick acquisition of the business identifiers of the business systems before and after the web page switching after the switching instruction is triggered.
[0079] In some embodiments, for situations where web page switching involves switching of business systems, see Figure 3B, the first web page can be switched to the second web page belonging to the second business system by executing the following steps 201-204: Step 201, obtain the web page menu data corresponding to the business identifier of the second business system; Step 202, render the web page menu of the second business system based on the web page menu data; Step 203, reset the first menu routing path of the first business system to the second menu routing path of the web page menu; Step 204, switch the first web page to the second web page based on the second menu routing path.
[0080] For step 201, the correspondence between the service identifier and the webpage menu data may be pre-stored, and then according to the correspondence, based on the service identifier of the second service system, the webpage menu data corresponding to the service identifier of the second service system is obtained. For example, firstly, a target interface for obtaining the webpage menu data is determined, and then based on the service identifier of the second service system, the target interface is called according to the correspondence to obtain the webpage menu data corresponding to the service identifier of the second service system.
[0081] For step 202, after acquiring the webpage menu data corresponding to the service identifier of the second service system, the webpage menu data is rendered to obtain the webpage menu of the second service system.
[0082] For step 203, since it is necessary to switch from the first web page of the first business system to the second web page of the second business system, the first menu routing path of the first business system is reset to the second menu routing path of the web page menu. It should be noted that when the web page switching involves the business system switching, the menu routing path needs to be reset. The menu routing path is the routing path between the menu and the menu function corresponding to the menu, which corresponds to the address path of the browser. Different menu routing paths point to different menu functions. Since the menus of different business systems are different, each time the business system is switched, the menu routing path needs to be reset to avoid the situation where, after the business system is switched, the user accesses the menu function of the business system before the switch through the menu displayed by the browser, and the "A system" sees / operates the menu function of the "B system".
[0083] For step 204, after resetting the first menu routing path of the first business system to the second menu routing path of the webpage menu, the first webpage is switched to the second webpage based on the second menu routing path. In some embodiments, based on the second menu routing path, the first webpage can be switched to the second webpage by performing the following steps: determining the third menu routing path of the first menu in the webpage menu from the second menu routing path; switching the first webpage to the second webpage corresponding to the third menu routing path. It should be noted that the first menu can be a menu in a pre-set webpage menu, such as the first menu in the webpage menu; the first menu can also be a random menu in the webpage menu; this is not limited here.
[0084] In some embodiments, in the case where web page switching involves switching of business systems, the first web page can also be switched to a second web page belonging to the second business system and adapted to the first account authority by executing the following steps: obtaining a second routing path of a business identifier of the second business system; changing the first routing path of the first business system to the second routing path; and switching the first web page to the second web page based on the second routing path.
[0085] Here, the correspondence between the business identification of the business system and the routing path of the business system can be pre-stored, and then when the first webpage of the first business system is switched to the second webpage of the second business system, based on the correspondence, according to the business identification of the second business system, the second routing path of the second business system is queried. Then the first routing path of the first business system is switched to the second routing path, and then based on the second routing path, the first webpage is switched to the second webpage. In actual applications, the routing path is used to indicate the business system. Since the business system includes at least one webpage, the routing path includes the page path of each webpage. When the first webpage is switched to the second webpage based on the second routing path, the first page path can be determined from the second routing path. The first page path can be the page path of a preset default webpage or the page path of a random webpage, and then the first webpage is switched to the second webpage corresponding to the first page path. In this way, by switching the routing path of the business system, the webpage switching when the business system is switched is realized.
[0086] In the related art, the business system switching is achieved by redirecting and refreshing the web page. There are two web pages before and after the business system switching. The domain names in the URLs before and after the switching are different. Therefore, after the business system is switched, all static resources of the target URL need to be reloaded, which takes a long time to load and store white screen time, resulting in poor user experience. In this application, the web application can be a single web application with a domain name. When switching the business system, there is no need to jump the domain name, load all the static resources of the web page of another domain name to jump to other web pages, and redirect and refresh the browser. It is just a reset of various data and route jumps between the web pages within the single web system. The web page switching efficiency is high, there is no white screen time, and the user experience is good.
[0087] Here, after switching from the first web page to the second web page, the first web page variable of the first web page is also stored, and the service identifier of the second service system is stored.
[0088] Here, after switching the first web page to the second web page, the business identifier of the second business system can be stored, that is: each time the web page switch involves a business system switch, it is necessary to store the business identifier of the business system to which the current web page belongs. For example, the business identifier of the second business system can be stored in a storage location, which can be a local storage location of the device (such as localstorage) or a storage location of a cloud server. The storage location is used to store the business identifier of the second business system when switching from a first web page of the first business system to a second web page of the second business system, that is, the storage location is used to store the business identifier of the business system to which the currently displayed web page belongs; after each business system switch, the business identifier of the storage location is updated to the business identifier of the business system before the most recent business system switch.
[0089] Here, the first web page variables of the first web page can also be stored. The first web page variables include the operation information performed by the user in the first web page, such as the form data filled in by the user in the first web page, the position of the web page scroll bar, etc.; in actual applications, the first web page variables can be obtained by snapshot recording and data backup, and the business identifier of the first web page and the first business system can be associated and stored. Thereby ensuring that when returning to the first web page, the user's operation information can be retained on the basis of refreshing the first web page, avoiding the user's operation again and improving the user experience. In actual applications, when the web page switching involves the business system switching, the business system variables of the first business system can be stored here, that is, the business system variables include the first web page variables. When returning to the first network of the first business system, the first web page can be displayed based on the first web page variables in the business system variables.
[0090] Step 103: In response to the first rollback instruction instructing to roll back to the third webpage, determine the service identifier in the URL of the third webpage, and determine a first time interval between the refresh time point of the third webpage and the triggering time point of the first rollback instruction.
[0091] Here, the first fallback instruction may be triggered. For example, the first fallback instruction may be triggered by a webpage fallback control of a browser. In actual applications, a webpage fallback event is detected, and when a webpage fallback event is detected, it is determined that the first fallback instruction has been received.
[0092] The first fallback instruction indicates a fallback from the currently displayed web page to a third web page, and the third web page is the historical web page that was most recently visited. In response to the first fallback instruction, the URL of the third web page is obtained, such as obtaining the URL of the third web page from the history stack of the browser, and then parsing the URL of the third web page to obtain the business identifier in the URL of the third web page. Continuing, the refresh time point of the third web page is obtained, and the trigger time point of the first fallback instruction is obtained, so as to determine the first time interval between the refresh time point and the trigger time point of the first-level web page. It should be noted that the refresh time point of the third web page is the most recent refresh time point or the latest refresh time point of the third web page.
[0093] Step 104: When the service identifier in the URL of the third webpage is different from the service identifier of the second service system and the first time interval reaches the time interval threshold, determine that the third webpage is the first webpage, and switch the second webpage to the refreshed first webpage based on the first webpage variable of the first webpage.
[0094] Here, after switching from the first web page to the second web page, the business identifier of the second business system will be stored in the storage location; based on this, first determine whether the business identifier in the URL of the third web page is the same as the business identifier of the stored second business system; when the business identifier in the URL of the third web page is different from the business identifier of the stored second business system, it means that the first fallback instruction triggered the switching of the business system, that is, the web page switching (fallback) indicated by the first fallback instruction involves the switching of the business system; when the business identifier in the URL of the third web page is the same as the business identifier of the stored second business system, it means that the first fallback instruction did not trigger the switching of the business system, that is, the web page switching (fallback) indicated by the first fallback instruction does not involve the switching of the business system, and is a web page switch within the same business system. At the same time, it is also determined whether the first time interval reaches a time interval threshold, which can be set in advance based on experience or demand. When the first time interval reaches the time interval threshold, it means that when returning to the first webpage, the first webpage needs to be refreshed to ensure that the content displayed on the first webpage is the latest content (for example, the dynamic resources in the webpage are the latest resources); when the first time interval does not reach the time interval threshold, it can be considered that when returning to the first webpage, the first webpage does not need to be refreshed. Based on this, the following processing is performed:
[0095] When the business identifier in the URL of the third webpage is different from the business identifier of the stored second business system and the first time interval reaches the time interval threshold, the third webpage is determined to be the first webpage, and the second webpage is switched to the refreshed first webpage, thereby achieving the switch from the second webpage of the second business system to the first webpage of the first business system. Specifically, the second webpage can be switched to the refreshed first webpage based on the stored first webpage variables, so that the first webpage variables before the refresh can be maintained, thereby improving the effect of webpage rollback.
[0096] When the business identifier in the URL of the third web page is different from the business identifier of the stored second business identifier and the first time interval does not reach the time interval threshold, the third web page is determined to be the first web page, and based on the stored first web page variable, the second web page is switched to the first web page, thereby realizing the switching from the second web page of the second business system to the first web page of the first business system.
[0097] When the service identifier in the URL of the third webpage is the same as the service identifier of the stored second service identifier and the first time interval does not reach the time interval threshold, the displayed fourth webpage belonging to the second service system is switched to the third webpage. Here, the fourth webpage is the currently displayed webpage, and the third webpage also belongs to the second service system.
[0098] When the service identifier in the URL of the third webpage is the same as the service identifier of the stored second service identifier and the first time interval reaches the time interval threshold, the displayed fourth webpage belonging to the second service system is switched to the refreshed third webpage. Here, the fourth webpage is the currently displayed webpage, and the third webpage also belongs to the second service system.
[0099] In some embodiments, based on the first web page variable of the first web page, the second web page can be switched to the refreshed first web page by executing the following steps: determining a first resource that can be reused in the second web page, and determining a second resource that is different from the first resource in the refreshed first web page; in the second web page, displaying the refreshed first web page by reusing the first resource and loading the first web page variable and the second resource.
[0100] Here, firstly, the first resource in the second webpage that can be reused by the refreshed first webpage is determined, and the first resource may include webpage resources such as js controls (responsible for interaction, such as form controls), styles, etc. At the same time, the second resource different from the first resource in the refreshed first webpage is also determined, and the second resource is the webpage resource unique to the refreshed first webpage. Based on this, in the second webpage, the refreshed first webpage is displayed by reusing the first resource, and loading the first webpage variable and the second resource. In this way, part of the resources in the second webpage are reused to display the refreshed first webpage, that is, the refreshed first webpage is not displayed by loading all resources. Some resources such as js controls and styles can be reused, and data related to the refreshed first webpage can be filled, so that all resources of the refreshed first webpage do not need to be reloaded, reducing the time consumption of webpage switching.
[0101] In some embodiments, a first web page belonging to a first business system can be displayed by executing the following steps: the first web page is displayed by running the first code of the first business system in a first environment; based on this, the first web page can be switched to a second web page belonging to a second business system by executing the following steps: the first web page is switched to the second web page by running the second code of the second business system in the second environment, and the second environment and the first environment are isolated from each other.
[0102] Here, the code of each business system is run in sandbox mode, that is, a corresponding operating environment is set for the code of each business system, so that the code of the business system is run in the operating environment of the business system. The operating environments of each business system are isolated from each other, which will prevent the code of each business system from interfering with each other and ensure the security of each business system itself. Based on this, the first web page is displayed by running the first code of the first business system in the first environment (i.e., the operating environment of the first business system). And, by running the second code of the second business system in the second environment (i.e., the operating environment of the second business system, the second environment and the first environment are isolated from each other), the first web page is switched to the second web page.
[0103] In some embodiments, the following steps can also be performed: storing a first web page variable of the first web page in the first environment; based on this, based on the first web page variable of the first web page, the second web page can be switched to the refreshed first web page by performing the following steps: based on the first web page variable in the first environment, switching the second web page to the refreshed first web page.
[0104] Here, the web page variables of the web pages of each business system (i.e., the global variables of the web pages) are also stored in the operating environment of the business system, that is, the first web page variables of the first web page are stored in the first environment; thereby, the accuracy and security of the global variables in the web page switching process can be guaranteed, and the web page variables of different business systems can be prevented from interfering with each other. Based on this, based on the first web page variables in the first environment, the second web page is switched to the refreshed first web page.
[0105] In some embodiments, the implementation process of switching the second webpage to the refreshed first webpage may also refer to the implementation process of switching the first webpage to the second webpage belonging to the second business system, which will not be repeated here.
[0106] In some embodiments, after the second web page is switched to the refreshed first web page, the following steps may be performed: the business identifier of the stored second business system is updated to the business identifier of the first business system. Here, after the second web page is switched to the first web page, the business identifier of the stored second business system is updated, that is: the business identifier of the stored second business system is updated to the business identifier of the first business system, that is, what is stored is the business identifier of the business system to which the current web page belongs. It can be understood that in the case where each web page switch involves a business system switch, the stored business identifier is updated to the business identifier of the business system after the business system switch. In this way, it can be ensured that the second web page of the second business system can be correctly switched back to the first web page of the first business system, thereby improving the accuracy of web page switching.
[0107] In some embodiments, after the second web page is switched to the refreshed first web page, the following steps may be performed: Step 301, in response to the second switching instruction, the refreshed first web page is switched to the sixth web page of the third business system, the URL of the third web page includes the business identifier of the third business system, and the sixth web page is adapted to the first account authority; Step 302, in response to the second fallback instruction indicating to fall back to the seventh web page, determine the business identifier in the URL of the seventh web page, and determine the second time interval between the refresh time point of the seventh web page and the triggering time point of the second fallback instruction; Step 303, when the business identifier in the URL of the seventh web page is different from the business identifier of the third business system and the second time interval reaches the time interval threshold, determine the seventh web page as the refreshed first web page, and switch the sixth web page to the refreshed first web page again based on the second web page variable of the refreshed first web page.
[0108] It should be noted that the specific implementation method of step 301 can refer to the specific implementation method of step 102, the specific implementation method of step 302 can refer to the specific implementation method of step 103, and the specific implementation method of step 303 can refer to the specific implementation method of step 104, which will not be repeated here.
[0109] Applying the above-mentioned embodiment of the present application, in response to a first switching instruction, a first web page belonging to a first business system and adapted to the first account authority is switched to a second web page belonging to a second business system and adapted to the first account authority; when a first fallback instruction instructing to fall back to a third web page is received, the business identifier in the URL of the third web page is determined, and the first time interval between the refresh time point of the third web page and the triggering time point of the first fallback instruction is determined, so that when the business identifier in the URL of the third web page is different from the business identifier of the second business system and the first time interval reaches the time interval threshold, based on the first web page variable, the second web page is switched to the refreshed first web page.
[0110] Here, 1) the first webpage of the first business system and the second webpage of the second business system are both adapted to the first account authority. In this way, the business personnel can support their business operations in different business systems without having to log in to different business systems separately, thereby improving the business processing efficiency of the business personnel.
[0111] 2) The URL of the second webpage includes the business identifier of the second business system, that is, the URL of the webpage includes the identifier of the business system to which the webpage belongs. Therefore, after the first webpage is switched to the second webpage, in response to the first fallback instruction, the business identifier in the URL of the third webpage is compared with the business identifier of the second business system. If the business identifier in the URL of the third webpage is different from the business identifier of the second business system, the third webpage is determined to be the first webpage, that is, this webpage fallback (that is, webpage switching) is a webpage switch between different business systems. Based on this, when the business identifier in the URL of the third webpage is different from the business identifier of the second business system and the first time interval reaches the time interval threshold, based on the first webpage variable, the second webpage is switched to the refreshed first webpage, thereby achieving the correct switching from the second webpage of the second business system back to the first webpage of the first business system before the webpage switching, and based on the first webpage variable, the refresh of the first webpage after the webpage fallback is achieved. In this way, not only the correct switching of webpages between different business systems is guaranteed, but also the correct refreshing of the webpage after the fallback is guaranteed, thereby improving the webpage switching effect.
[0112] The following describes an exemplary application of the embodiments of the present application in a practical application scenario.
[0113] A software system is a multi-tenant design. Each tenant has multiple project spaces. Each project space is associated with different product sets and users. Users are associated with roles and roles are bound to menus. A user can join multiple project spaces and can be the platform administrator of the entire software system at the same time, or he can be an ordinary user of the software system. From the perspective of service objects, the software system can be divided into end A, end B, and end C. A set of business processes often requires related operations from different ends (such as end A, end B, and end C) to be completed, and business personnel often need to log in to different project spaces to complete corresponding business operations. Therefore, in the related technology, multiple front-end systems are made for different ends. When a user with multi-end permissions needs to switch systems, a hyperlink jump or redirection is performed to refresh the web page. However, the following problems exist:
[0114] Problem (1) Multiple sets of web front-end project source code, multiple sets of front-end systems deployed, low reusability of web pages and components, and waste of deployment resources. Specifically, different front-end systems are divided for different ends, such as management end system, portal end system, etc. In development, multiple sets of front-end systems are developed separately, and similar functions will be repeatedly developed, such as system layout framework, menu and other common web page blocks. Multiple sets of front-end systems are deployed separately, and for front-end systems that require domain names, multiple domain names need to be applied for.
[0115] Problem (2) When switching, the front-end system jumps, which creates a strong sense of disconnection; when redirecting to refresh the web page, the white screen lasts for a long time, which leads to a poor user experience. Specifically, whether it is a hyperlink jump or a redirect to refresh the web page, all static resources of the target front-end system will be reloaded, resulting in many network requests and long waiting times. Moreover, if the front-end system jumps, it gives the user a sense of disconnection, which results in a poor overall user experience.
[0116] Problem (3) The front-end system jump requires login authorization, such as single sign-on and other shared session technologies. Specifically, because multiple front-end systems are deployed, switching front-end systems, jumping or redirecting refreshes all involve session login. If the session is not opened, a login will be required during the initial switch; if the session is opened, it will require a certain amount of cost for the research and development of session sharing, which is not good for user experience and cost.
[0117] Based on this, the embodiment of the present application provides the following technical solution: a single-page web application (SPA) is deployed using a set of project source code, and the single-page web application integrates multiple business systems, such as business systems used by end A, end B, and end C. A business system is a module with relatively independent business functions. For example, public functions such as user session, login, authentication, and monitoring are classified as a relatively independent management system, and other specific business implementations, such as functional modules related to the bank fund system, are classified as a business system.
[0118] After the user logs in to the account in the single-page web application, the user's account permissions are used to determine which business systems the user owns (the same account can have permissions for multiple business systems, for example, the user belongs to multiple project spaces at the same time and has management permissions). Based on this, the embodiment of the present application is also different from the related technology when switching between different business systems. When switching web pages between different business systems, the embodiment of the present application does not perform jumps or redirect refreshes between business systems, but resets the web page data of the corresponding business system in the single-page web application, specifically resets the global state data, such as resetting menus, resetting routing permissions, resetting the business identification of the business system, etc. Since the embodiment of the present application does not involve the jump of business systems and does not involve the overloading of a large number of static resources, it only calls the web page data of the target business system through the interface to reset the web page, which has better overall performance and better user experience.
[0119] Based on this, the embodiment of the present application can solve the above problem (1). Specifically, the embodiment of the present application adopts a SPA single web page project for switching and data reset. Only one front-end system needs to be deployed, and components and web pages can be highly reusable, which will be more cost-effective in terms of R&D cost and deployment cost.
[0120] The embodiment of the present application can also solve the above problem (2). Specifically, the embodiment of the present application adopts a SPA single web page project. When switching business systems, there is no need to jump to other web pages or redirect and re-refresh the browser. It only resets various data and routes within the single web page system. There is no white screen time, and the user experience is good.
[0121] The embodiment of the present application can also solve the above problem (3). Specifically, the embodiment of the present application essentially has only one web single page application, and only needs to log in once. When switching between web pages of different business systems, it is always a session, and there is no logout. It just re-pulls the relevant data of the target business system (such as menu data, menu permission data, etc.), and then resets the web front-end single page to achieve the switching of business systems.
[0122] Continuing, the embodiments of the present application can also solve the problem of correct browser rollback between "business systems". When switching business systems, the embodiment of the present application essentially resets various web page data at the correct time. When the browser moves forward or backward within the business system, the business system can operate normally. However, when it comes to the critical point of business system switching, if the browser rollback cannot correctly identify the business identifier of the business system before the business system is switched, the web page cannot be reset. Therefore, the embodiments of the present application also need to ensure that the browser correctly rolls back to the original business system before the business system is switched at the correct time.
[0123] See next Figure 5 The web page switching method provided in the embodiment of the present application is described. Figure 5 This is a third flow chart of the webpage switching method provided in the embodiment of the present application. Among them, the following steps 2 to 4 correspond to Figure 5 Switching logic area in; the following steps 5-6 correspond to Figure 5 The operation and browser fallback logic in .
[0124] Step 1: Integrate multiple business systems into a single web project.
[0125] Here, the webpage switching between different business systems in the related art is actually jumping between multiple business systems. Multiple business systems deploy multiple service addresses, and jump back and forth when switching. The first thing this application does is to integrate the front-end codes of multiple business systems into a single webpage web application, and the different functions of each business system serve as a business module of the single webpage web application.
[0126] Step 2: The user logs in to the single-page web application and enters the preset default "business system".
[0127] Here, after the user enters the account password and logs in successfully, the backend interface returns the end permissions owned by the user and the list of business system organizations joined, and provides a default end and business system LabId (i.e. business identifier). When the login is successful, the backend stores the default business system LabId in the browser cache LocalStorage, and also synchronizes it to the browser URL as a browser address parameter. The front-end system uses the default LabId as a query condition to query the menu corresponding to the current "business system".
[0128] Step 3: The user switches the "Business System", queries the data of the target business system, and then resets the global status data of the web front end.
[0129] Here, when the user clicks on the navigation bar to switch to the target business system, the front-end system will send a request to the back-end with the business ID (LabId) of the selected target business system to query the menu tree data of the target business system. If the request fails or the menu tree data of the corresponding target business system is not found, a pop-up window will pop up to remind the user that the web page switch failed. If the menu tree data is found, the system will reset the global state of the front-end web system, such as the state management data stored in redux / zustand, the local persistent global data stored in localStorage in the previous "business system", etc. In short, all related web front-end global state data will be reset; the menu tree will be re-rendered, and the front-end routing permissions (that is, the above-mentioned menu routing path) will be reset according to the menu data. Finally, according to the routing permissions, the system web page is routed to the web page of the first menu item of the menu of the target business system. In this way, the switching of the business system is completed.
[0130] Step 4: Set the routing permissions for the target business system and jump to the function page of the first menu.
[0131] Here, after resetting the global state data of the web front-end system, the menu tree of the target business system is re-rendered, the routing authority of the menu tree of the target business system is reset, and the function webpage corresponding to the first menu item of the menu tree is switched to.
[0132] Step 5: Monitor the changes of the browser URL in real time, and add the business ID of the current target business system as a parameter to the URL in real time.
[0133] Here, the purpose of splicing the business identifier labId of the target business system as a parameter into the browser address bar is to store the business identifier in the browser's history stack as the browser address changes. When you click the browser back or forward button, you can get the business identifier labId before and after the change. Specifically, monitor the browser history object in real time. When the web page address changes, it triggers the acquisition of the search parameter in the location object. By obtaining the labId in the search, the labId is compared with the labId in the browser's local cache localStorage. If they are the same, it means that the current browser address change belongs to the web page change within the business system and does not involve switching the business system. At this time, the labId continues to be stored in the url.
[0134] Step 6: After switching to the "Business System", perform normal business operations that cause route changes (URL changes) and click the browser's back button to return to the bottom of the browser history stack.
[0135] Here, when going back to before switching the "business system", if the labId is different from the labId in the browser's local cache localStorage, it means that the current browser address change (forward or backward) is switching the business system. At this time, the labId obtained in the url needs to be used as the current business system identifier, and the labId needs to be updated to the local storage localStorage, and the business system switching operation is performed at the same time.
[0136] In other embodiments, when switching business systems, different business systems can be distinguished by assigning different routing paths to different business systems, for example: the routing prefix / admin is the business system of the management end of end A; the routing prefix / bussness is the business system of the business end of end B; the routing prefix / user is the business system of the user end of end C. When the web pages of the business systems of each end are switched, they can be routed to different routing paths. The routing prefix can be the system identifier of the business system.
[0137] Applying the above embodiments of the present application, 1) compared with the existing technology, the R&D efficiency is higher and the deployment cost is lower. As described in step 1 above, the present application adopts a SPA single webpage project, integrating multiple business systems into one project, and switching business systems from jumping between addresses of related technologies to switching within a project, just need to ensure that the data can be correctly reset and rolled back; and the present application only writes business function codes in one project, components and web pages can achieve high reusability, and only need to deploy one set of front-end systems, which will be better in both R&D cost and deployment cost.
[0138] 2) No white screen, no long wait for jumps, and better user experience. As described in step 1 above, this application uses a SPA single web page project to integrate multiple business systems into one project, and the switching of business systems is changed from jumping between the addresses of related technologies to switching within a project; as described in step 4, after switching the business system, the system will reset the routing authority and jump to the first menu item. Here it is just a routing switch instead of jumping to other domain name web pages, and there is no need to redirect and refresh the browser. It is just a reset of various data and routing jumps within the single web page system. There is basically no white screen time when loading web pages, and the user experience is good.
[0139] 3) No session connection between systems is involved, and the login experience is better. The embodiment of the present application has only one web single page application (corresponding to step 1), and only needs to be logged in once. When switching between web pages of different business systems, it is always a session, and there is no logout. It only re-pulls the relevant data (menus, permissions) of the target system, and then resets the web front-end single page system to achieve the switching of web pages between different business systems.
[0140] 4) It supports the situation where the user belongs to multiple terminals, and also supports users to join and switch between multiple different project spaces. In a specific business scenario, a user may have permissions to multiple terminals (A\B\C) at the same time, and the menus and routing permissions of different terminals are also different. The user may also join multiple project spaces or organizations and different business systems in the B terminal at the same time, and the menus, role permissions, etc. under different project spaces are also different. Therefore, when switching these terminals and different project spaces, this application integrates the specific implementation of the above steps, and a single web page application records the "business system" identifier in the browser history stack. By resetting various global states, browser local cache, and combining the characteristics of the browser history stack URL, it comprehensively implements the switching of complex business systems in more dimensions.
[0141] It should be noted that the switching of different business systems involved in the embodiments of the present application actually refers to the switching of web pages between different business systems. For example, switching from business system 1 to business system 2 actually refers to switching from web page 1 belonging to business system 1 to web page 2 belonging to business system 2.
[0142] The following is a description of an exemplary structure of a webpage switching device 555 provided in an embodiment of the present application implemented as a software module. In some embodiments, Figure 2As shown, the software modules stored in the web page switching device 555 of the memory 550 may include: a display module 5551, which is used to display a first web page belonging to a first business system, and the first web page is adapted to the first account authority; a first switching module 5552, which is used to switch the first web page to a second web page belonging to a second business system in response to a first switching instruction, and the URL of the second web page includes a business identifier of the second business system, and the second web page is adapted to the first account authority; a determination module 5553, which is used to determine the business identifier in the URL of the third web page in response to a first fallback instruction indicating to fall back to a third web page, and determine a first time interval between a refresh time point of the third web page and a triggering time point of the first fallback instruction; a second switching module 5554, which is used to determine that the third web page is the first web page when the business identifier in the URL of the third web page is different from the business identifier of the second business system and the first time interval reaches a time interval threshold, and switch the second web page to the refreshed first web page based on the first web page variable of the first web page.
[0143] In some embodiments, the first switching module 5552 is further used to obtain web page menu data corresponding to the business identifier of the second business system; based on the web page menu data, render the web page menu of the second business system; reset the first menu routing path of the first business system to the second menu routing path of the web page menu; based on the second menu routing path, switch the first web page to the second web page.
[0144] In some embodiments, the first switching module 5552 is further used to determine a third menu routing path of the first menu in the web page menu from the second menu routing path; and switch the first web page to a second web page corresponding to the third menu routing path.
[0145] In some embodiments, the second switching module 5554 is also used to determine a first resource that can be reused in the second web page, and to determine a second resource that is different from the first resource in the refreshed first web page; in the second web page, the refreshed first web page is displayed by reusing the first resource and loading the first web page variable and the second resource.
[0146] In some embodiments, the display module 5551 is also used to display the first web page by running the first code of the first business system in the first environment; the first switching module 5552 is also used to switch the first web page to the second web page by running the second code of the second business system in the second environment, and the second environment and the first environment are isolated from each other.
[0147] In some embodiments, the first switching module 5552 is further used to store the first web page variable of the first web page in the first environment; the second switching module 5554 is further used to switch the second web page to the refreshed first web page based on the first web page variable in the first environment.
[0148] In some embodiments, the first account authority corresponds to the first account, and the second switching module 5554 is further used to, after switching the second webpage to the refreshed first webpage, in response to switching from the first account to the second account, switch the first webpage to a fifth webpage belonging to the first business system, and the fifth webpage is adapted to the second account authority of the second account.
[0149] In some embodiments, the first switching module 5552 is further used to obtain a second routing path corresponding to the business identifier of the second business system; change the first routing path of the first business system to the second routing path; and switch the first web page to the second web page based on the second routing path.
[0150] In some embodiments, the second switching module 5554 is further used to determine that the third web page is the first web page, and switch the second web page to the first web page based on the first web page variable, when the business identifier in the URL of the third web page is different from the business identifier of the second business identifier and the first time interval does not reach the time interval threshold; when the business identifier in the URL of the third web page is the same as the business identifier of the second business identifier and the first time interval does not reach the time interval threshold, switch the displayed fourth web page belonging to the second business system to the third web page; when the business identifier in the URL of the third web page is the same as the business identifier of the second business identifier and the first time interval reaches the time interval threshold, switch the displayed fourth web page belonging to the second business system to the refreshed third web page.
[0151] In some embodiments, the first switching module 5552 is further used to store the business identifier of the second business system in a storage location after the first web page is switched to a second web page belonging to the second business system and adapted to the first account authority; the first switching module 5552 is further used to update the business identifier of the second business system stored in the storage location to the business identifier of the first business system after the second web page is switched to the refreshed first web page.
[0152] In some embodiments, the second switching module 5554 is also used to, after switching the second web page to the refreshed first web page, in response to a second switching instruction, switch the refreshed first web page to a sixth web page belonging to a third business system, the URL of the sixth web page includes the business identifier of the third business system, and the sixth web page is adapted to the first account authority; in response to a second fallback instruction instructing to fall back to the seventh web page, determine the business identifier in the URL of the seventh web page, and determine the second time interval between the refresh time point of the seventh web page and the triggering time point of the second fallback instruction; when the business identifier in the URL of the seventh web page is different from the business identifier of the third business system and the second time interval reaches the time interval threshold, determine the seventh web page as the refreshed first web page, and switch the sixth web page to the refreshed first web page again based on the second web page variable of the refreshed first web page.
[0153] It should be noted that the description of the device embodiment in this application is similar to the description of the method embodiment above, and has similar beneficial effects as the method embodiment, which will not be described in detail here. The unfinished technical details in the webpage switching device provided in the embodiment of this application can be understood based on the description of the technical details in the method embodiment above.
[0154] The embodiment of the present application also provides a computer program product, which includes computer executable instructions or computer programs, and the computer executable instructions or computer programs are stored in a computer readable storage medium. The processor of the electronic device reads the computer executable instructions or computer program from the computer readable storage medium, and the processor executes the computer executable instructions or computer program, so that the electronic device executes the web page switching method provided in the embodiment of the present application.
[0155] The embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will execute the web page switching method provided in the embodiment of the present application.
[0156] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0157] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0158] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0159] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
[0160] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A web page switching method, characterized in that: The method comprises: Displaying a first webpage belonging to a first business system, wherein the first webpage is adapted to the first account authority; In response to the first switching instruction, the first webpage is switched to a second webpage belonging to a second business system, the URL of the second webpage includes a business identifier of the second business system, and the second webpage is adapted to the first account authority; In response to a first rollback instruction instructing to roll back to a third webpage, determining a service identifier in the URL of the third webpage, and determining a first time interval between a refresh time point of the third webpage and a triggering time point of the first rollback instruction; When the business identifier in the URL of the third webpage is different from the business identifier of the second business system and the first time interval reaches the time interval threshold, the third webpage is determined to be the first webpage, and based on the first webpage variable of the first webpage, the second webpage is switched to the refreshed first webpage.
2. The method according to claim 1, characterized in that The step of switching the first webpage to a second webpage belonging to a second business system includes: Determine web page menu data corresponding to the service identifier of the second service system; Based on the webpage menu data, rendering to obtain a webpage menu of the second business system; Resetting the first menu routing path of the first business system to the second menu routing path of the webpage menu; Based on the second menu routing path, the first web page is switched to the second web page.
3. The method according to claim 2, characterized in that The step of switching the first webpage to the second webpage based on the second menu routing path includes: Determining a third menu routing path of the first menu in the webpage menu from the second menu routing path; The first web page is switched to a second web page corresponding to the third menu routing path.
4. The method according to claim 1, characterized in that The step of switching the second web page to the refreshed first web page based on the first web page variable of the first web page includes: Determine a first resource that can be reused in the second webpage, and determine a second resource that is different from the first resource in the refreshed first webpage; In the second web page, the refreshed first web page is displayed by reusing the first resource and loading the first web page variable and the second resource.
5. The method according to claim 1, characterized in that The displaying of the first webpage belonging to the first business system includes: Displaying the first webpage by running the first code of the first business system in the first environment; The step of switching the first webpage to a second webpage belonging to a second business system includes: The first webpage is switched to the second webpage by running the second code of the second business system in the second environment, and the second environment and the first environment are isolated from each other.
6. The method according to claim 5, characterized in that The method further comprises: storing a first web page variable of the first web page in the first environment; The step of switching the second web page to the refreshed first web page based on the first web page variable of the first web page includes: Based on the first webpage variable in the first environment, the second webpage is switched to the refreshed first webpage.
7. The method according to claim 1, characterized in that The first account authority corresponds to the first account, and after the second webpage is switched to the refreshed first webpage, the method further includes: In response to switching from the first account to the second account, the first webpage is switched to a fifth webpage belonging to the first business system, and the fifth webpage is adapted to the second account authority of the second account.
8. The method according to claim 1, characterized in that The step of switching the first webpage to a second webpage belonging to a second business system includes: Obtaining a second routing path corresponding to the service identifier of the second service system; Change the first routing path of the first service system to the second routing path; Based on the second routing path, the first webpage is switched to the second webpage.
9. The method according to claim 1, characterized in that The method further comprises: When the service identifier in the URL of the third webpage is different from the service identifier of the second service identifier and the first time interval does not reach the time interval threshold, determining that the third webpage is the first webpage, and switching the second webpage to the first webpage based on the first webpage variable; When the service identifier in the URL of the third webpage is the same as the service identifier of the second service identifier and the first time interval does not reach the time interval threshold, switching the displayed fourth webpage belonging to the second service system to the third webpage; When the service identifier in the URL of the third webpage is the same as the service identifier of the second service identifier and the first time interval reaches the time interval threshold, the displayed fourth webpage belonging to the second business system is switched to the refreshed third webpage.
10. The method according to any one of claims 1 to 9, characterized in that: After switching the first webpage to a second webpage belonging to a second business system, the method further includes: Storing the service identifier of the second service system in a storage location; After switching the second webpage to the refreshed first webpage, the method further includes: The service identifier of the second service system stored in the storage location is updated to the service identifier of the first service system.
11. The method according to claim 1, characterized in that After switching the second webpage to the refreshed first webpage, the method further includes: In response to the second switching instruction, the refreshed first webpage is switched to a sixth webpage belonging to the third business system, the URL of the sixth webpage includes the business identifier of the third business system, and the sixth webpage is adapted to the first account authority; In response to a second rollback instruction instructing to roll back to a seventh webpage, determining a service identifier in the URL of the seventh webpage, and determining a second time interval between a refresh time point of the seventh webpage and a triggering time point of the second rollback instruction; When the business identifier in the URL of the seventh web page is different from the business identifier of the third business system and the second time interval reaches the time interval threshold, the seventh web page is determined to be the refreshed first web page, and based on the second web page variable of the refreshed first web page, the sixth web page is switched to the refreshed first web page again.
12. A web page switching device, characterized in that: The device comprises: A display module, configured to display a first webpage belonging to a first business system, wherein the first webpage is adapted to the first account authority; A first switching module, configured to switch the first webpage to a second webpage belonging to a second business system in response to a first switching instruction, wherein the URL of the second webpage includes a business identifier of the second business system, and the second webpage is adapted to the first account authority; a determination module, configured to determine, in response to a first rollback instruction instructing to roll back to a third webpage, a service identifier in the URL of the third webpage, and determine a first time interval between a refresh time point of the third webpage and a triggering time point of the first rollback instruction; The second switching module is used to determine that the third web page is the first web page when the business identifier in the URL of the third web page is different from the business identifier of the second business system and the first time interval reaches the time interval threshold, and switch the second web page to the refreshed first web page based on the first web page variable of the first web page.
13. An electronic device, characterized in that: The electronic device comprises: A memory for storing computer executable instructions; The processor is used to implement the web page switching method described in any one of claims 1 to 11 when executing the computer executable instructions stored in the memory.
14. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer programs are executed by a processor, the web page switching method according to any one of claims 1 to 11 is implemented.
15. A computer program product comprising computer executable instructions or a computer program, characterized in that When the computer executable instructions or computer programs are executed by a processor, the web page switching method according to any one of claims 1 to 11 is implemented.