Method for integrating multiple applications into PC (Personal Computer) client based on Electron framework
Through the integration of the Electron framework and core functions, it solves the problems of long development cycle and application independence of multi-application integrated PC clients, achieves cross-platform and security, reduces costs, and provides an efficient and flexible multi-application integration solution. .
Patent Information
- Application Number
- CN202410616896.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-23
AI Technical Summary
Existing multi-application integrated PC client solutions have long development cycles, repeated construction, difficulties in cross-platform implementation, low application code reusability, impaired application independence and functional integrity, high integration costs, and difficulty in taking advantage of the original functions. problem.
Use the Electron framework to create a unified service portal application, integrating core functions such as unified registration and login authentication, menu function registration, permission allocation, message system, independent application portal configuration and message synchronization channel, through the menu function registration method or the overall front-end application packaging method. The target application is integrated into the service portal application to ensure the independence and functional integrity of the application.
It improves development efficiency and reusability, enhances the cross-platform and compatibility of applications, ensures the independence and integrity of applications, improves system security and stability, reduces integration costs and maintenance costs, and provides Efficient, flexible and secure multi-application integration solution.
Smart Images

Figure CN118535219A
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of software development and desktop application development, and in particular to a method for integrating multiple applications into a PC client based on an Electron framework. Background Art
[0002] With the rapid development of computer and network technology, the accelerated advancement of enterprise informatization and digital transformation, platform-based and medium-sized enterprises are facing more and more WEB business application needs. Enterprises usually have many independent WEB application systems, which are managed by different R&D teams and scattered on different platforms and services, resulting in fragmented user experience, increased management complexity and rising maintenance costs. In this case, how to unify the application portal and effectively integrate these applications into a PC client program has become a demand and problem that needs to be solved urgently.
[0003] Although there are some multi-application integrated PC client solutions in the current market, these solutions often have some disadvantages. First, many solutions use traditional desktop application development technology, which has a long development cycle, repeated construction, high cost, and difficulty in achieving cross-platform. Secondly, these solutions have low reusability of existing application codes and often lack protection for application independence and functional integrity, making the integrated application cost high and may not be able to give full play to its original functional advantages. In addition, many solutions lack flexibility and scalability, making it difficult to adapt to the ever-changing business needs of enterprises. Summary of the invention
[0004] In view of this, the purpose of the present invention is to propose a method for integrating multiple applications into a PC client based on the Electron framework, aiming at the demand of integrating multiple applications into a PC client with a unified application portal, aiming to solve the problems of long development cycle, repeated construction, difficulty in cross-platform implementation, low application code reusability, impaired application independence and functional integrity, high integration cost and difficulty in exerting the original functional advantages in the existing integration scheme. The method utilizes the efficient construction and integration capabilities of the Electron framework, significantly improves the reuse rate of existing application codes, and ensures the independence and functional integrity of each application. In addition, through the cross-platform characteristics of Electron, the system can run smoothly on different operating systems, showing excellent compatibility and scalability.
[0005] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0006] The present invention provides a method for integrating multiple applications into a PC client based on an Electron framework, comprising the following steps:
[0007] Step 1. Use the Electron framework to create a unified service entry application;
[0008] Step 2: Integrate core functions into the service portal application;
[0009] Step 3: Transform the target application that needs to be integrated into the service portal application through the core function;
[0010] Step 4: Select the corresponding integration method and integrate the transformed target application into the service entry application through the core function;
[0011] Step 5: deploy and publish the service portal application on the web side and package and publish it on the PC client side across platforms.
[0012] Furthermore, the step 1 specifically includes:
[0013] Step 11: Use the Electron framework as a development basis, which allows development using Web technologies.
[0014] Step 12: Use Web technology to build a unified service entry application.
[0015] Furthermore, the core functions in step 2 specifically include:
[0016] Unified registration, login and authentication function: Provide a unified registration and login mechanism for all target applications to be integrated;
[0017] Menu function registration function: allows each target application to register its own function menu;
[0018] Permission allocation function: assign corresponding permissions to each target application based on the user's role and identity;
[0019] Messaging system function: Establish a unified messaging system to deliver messages and notifications between various target applications;
[0020] Independent application entry configuration function: configure an independent access entry for each target application;
[0021] Application window routing configuration function: provides routing configuration, allowing the service entry application to manage the opening and closing of windows of each target application;
[0022] Iframe public container function: provides a public iframe container for loading and displaying pages of various target applications;
[0023] Independent application window function: Create independent windows for independent applications through the BrowserWindow module;
[0024] Message synchronization channel function: put the message into the message system, and use the PostMessage function to obtain the message in the message system, which includes user information, permission information and other information.
[0025] Furthermore, the step 3 specifically includes:
[0026] Step 31: Connect the target application to a unified registration and login mechanism through the unified registration and login authentication function provided by the service portal application;
[0027] Step 32: Connect the target application to the acquisition channel of user information, permission information and other information through the message synchronization channel function provided by the service portal application.
[0028] Furthermore, the corresponding integration method in step 4 includes a menu function registration method and a front-end application overall packaging method.
[0029] Furthermore, the menu function registration method specifically includes:
[0030] The administrator uses the menu function registration function provided by the service portal application to register the function page and page function point information of the target application to the permission center of the service portal application for permission management;
[0031] In the permission center, the administrator manages the permissions of the functions registered by the target application through the permission allocation function provided by the service portal application;
[0032] According to the user's permissions, the function page of each target application after registration is opened through the iframe public container function provided by the service portal application.
[0033] Furthermore, after registering the function page and page function point information of the target application to the permission center of the service entry application for permission management, the following steps are further included:
[0034] Based on actual needs, the administrator combines different functions in the permission center of the service portal application to form a function menu set.
[0035] Furthermore, the overall packaging method of the front-end application specifically includes:
[0036] For target applications developed with a front-end framework, the front-end application is packaged as a whole and integrated into the service entry application;
[0037] After the target application is packaged, a deployment package containing all necessary resources is generated;
[0038] Copy the generated deployment package to the specified directory of the service entry application;
[0039] In the main process management of the service entry application, an independent application window of the target application is created through an independent application window function provided by the service entry application;
[0040] Configure the routing mode of the target application window through the application window routing configuration function provided by the service portal application;
[0041] Define the access entry of the target application in the service entry application through the independent application entry configuration function provided by the service entry application;
[0042] The target application is used as a sub-application or functional module of the service entry application, and the deployment package in the specified directory and the service entry application are released and updated as a whole.
[0043] Furthermore, the methods of loading and running resources of the independent application window of the target application include: using electron-serve to load and running resources and using loadFile to load and running resources.
[0044] Furthermore, after configuring the routing mode of the target application window through the independent application entry provided by the service entry application, the method further includes:
[0045] By managing the callback function when the main process of the Electron framework opens a new window or tab and listening to the will-navigate and will-redirect events, the route configuration opened for the independent application window is managed.
[0046] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0047] 1. Improved development efficiency and reusability: By using the Electron framework, developers can use familiar Web technologies (HTML, CSS, JavaScript) to build desktop applications, which greatly reduces the difficulty of development and learning costs. In addition, the Electron framework allows developers to reuse existing Web application code, avoiding repeated development, reducing R&D costs and maintenance costs, and significantly improving code reusability and development efficiency; at the same time, the web side and the desktop client (PC client) can use the same set of entry application projects, using the convenience of Web technology development resources and talent reserves, and can quickly build and integrate multiple applications into a single PC client;
[0048] 2. Enhanced cross-platform and compatibility of applications: By utilizing the cross-platform compatibility of the Electron framework, the solution of the present invention can be run on different operating systems to meet the diverse needs of enterprises; since the Electron framework itself has cross-platform characteristics, the multi-application integrated PC client built on Electron can also run smoothly on different operating systems, including Windows, macOS, and Linux. This cross-platform nature enables the system to easily adapt to different enterprise environments and user needs, enhancing the compatibility and scalability of the system.
[0049] 3. Ensure the independence and integrity of applications: By independently encapsulating each application, independent entrances and windows can be configured for the application, ensuring that the independence and functional integrity of each application can be maintained after integration, ensuring that users can enjoy the original application functions and user experience.
[0050] 4. Improved system security and stability: Through unified registration, login authentication and authority allocation mechanism, the present invention ensures the security and consistency of user information and prevents unauthorized access and malicious operations. At the same time, through functions such as message system and window management, the system can process and respond to various events and requests in a timely manner, improving the stability and reliability of the system.
[0051] 5. Reduced integration and maintenance costs: Due to the use of a unified service portal application design, flexible menu function registration and permission management are provided, which simplifies the application integration process and reduces integration costs. The system has good scalability and maintainability. Enterprises can flexibly adjust and expand system functions according to business needs. It has flexibility and scalability, can adapt to the ever-changing business needs of enterprises, and reduces the cost and difficulty of later maintenance.
[0052] In summary, the method of integrating multiple applications into PC client based on Electron framework provides enterprises with an efficient, flexible and secure multi-application integration solution by improving development efficiency and reusability, enhancing cross-platform and compatibility of applications, ensuring independence and integrity of applications, improving system security and stability, and reducing integration and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1It is a schematic diagram of the execution flow of a method for integrating multiple applications into a PC client based on the Electron framework provided by an embodiment of the present invention.
[0055] Figure 2 It is a schematic diagram of the effect of integration using a menu function registration method provided by an embodiment of the present invention.
[0056] Figure 3 It is a schematic diagram of a menu function registration management interface provided by an embodiment of the present invention.
[0057] Figure 4 It is a schematic diagram of the effect of integrating the front-end application in an overall packaging manner provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0059] See also Figure 1 The present invention provides a method for integrating multiple applications into a PC client based on the Electron framework, comprising the following steps:
[0060] Step 1. Use the Electron framework to create a unified service entry application;
[0061] In this embodiment, the step 1 specifically includes:
[0062] Step 11: Use the Electron framework as the development basis. The Electron framework allows development using Web technologies, including HTML, CSS, and JavaScript. Electron is an open source, cross-platform desktop application development tool that allows developers to use front-end technologies (HTML, CSS, and JavaScript) to build desktop applications. Through Electron, developers can integrate Web technologies with Node.js to develop feature-rich desktop applications.
[0063] Step 12: Use Web technology to build a unified service portal application (a desktop application). The service portal application is responsible for implementing a series of core functions, including but not limited to cross-platform packaging, version updates, local storage management, and window management. These functions ensure the stability and scalability of the service portal application. At the same time, the service portal application also serves as a unified service portal for web applications.
[0064] Step 2: Integrate core functions into the service portal application;
[0065] In this embodiment, the core functions in step 2 specifically include:
[0066] Unified registration, login and authentication function: Provide a unified registration and login mechanism for all target applications to be integrated to ensure the security and consistency of user information;
[0067] Menu function registration function: allows each target application to register its own function menu so that it can be displayed in the interface of the service entry application;
[0068] Permission allocation function: assign corresponding permissions to each target application according to the user's role and identity to ensure the security of the system;
[0069] Messaging system function: Establish a unified messaging system to deliver messages and notifications between various target applications;
[0070] Independent application entry configuration function: configure an independent access entry for each target application to facilitate users to quickly access;
[0071] Application window routing configuration function: provides routing configuration, allowing the service entry application to manage the opening and closing of windows of each target application;
[0072] iframe public container function: Provides a public iframe container to load and display pages of various target applications; iframe is an HTML tag that acts as a document within a document, or a floating frame (FRAME). The iframe element creates an inline frame (i.e., an inline frame) that contains another document;
[0073] Independent application window function: Create independent windows for independent applications through the BrowserWindow module to ensure the independence of the application and user experience; the BrowserWindow module is used to create and manage graphical user interface windows, and it provides a way to create native windows in desktop applications;
[0074] Message synchronization channel function: put the message into the message system, use the PostMessage function to get the message in the message system, the message includes user information, permission information and other information; PostMessage is a common function in Windows API (application programming interface), which is used to put a message into the message queue; use the PostMessage technical solution to solve the browser homology policy restriction problem, and ensure the efficient and secure transmission of user information, permission information and other key information between the service entry application and the page in the iframe container.
[0075] Step 3: Transform the target application that needs to be integrated into the service portal application through the core function;
[0076] In this embodiment, step 3 specifically includes:
[0077] Step 31: Connect the target application to a unified registration and login mechanism through the unified registration and login authentication function provided by the service portal application to ensure the consistency and security of user information;
[0078] Step 32: The target application is connected to the acquisition channel of user information, permission information and other information through the message synchronization channel function provided by the service portal application to ensure smooth interaction and data synchronization with the service portal application.
[0079] Step 4: Select the corresponding integration method and integrate the transformed target application into the service entry application through the core function;
[0080] In this embodiment, the corresponding integration methods in step 4 include a menu function registration method and a front-end application overall packaging method.
[0081] The menu function registration method is a flexible and efficient application integration method, which specifically includes:
[0082] Menu function registration: The administrator uses the menu function registration function provided by the service portal application to register the function page and page function point information (such as URL, function description, required permissions, etc.) of the target application to the permission center of the service portal application for permission management;
[0083] Menu combination: Based on actual needs, administrators can combine different functions in the permission center of the service portal application to form a function menu set; that is, these functions can be combined across applications to form a product with complete functions, which can then be authorized to users or the user's enterprise for use, and sub-category applications can be published independently. Since this combination can span multiple applications, flexible integration of functions can be achieved.
[0084] Permission management: In the permission center, administrators manage the permissions of the functions registered by the target application through the permission allocation function provided by the service portal application, ensuring that different users or enterprises can only access their authorized functions.
[0085] iframe container opening and use: Based on user permissions, the iframe public container function provided by the service portal application opens the function page of each target application after registration. This method allows the service portal application to not care about the internal implementation details of the target application, but only needs to provide the container.
[0086] Flexibility and scalability: Due to the menu function registration method, the solution is highly flexible and scalable. Administrators can add, modify or delete functions at any time according to business needs without waiting for the release plan of the service portal application.
[0087] Applicable scenarios: This solution is particularly suitable for applications with fast function iteration speed and application scenarios where the front-end and back-end are not separated. It allows applications to be integrated quickly without being restricted by the release plan of the service entry application.
[0088] The overall packaging method of the front-end application specifically includes:
[0089] For target applications developed using front-end frameworks (such as Node.js, HTML, CSS, VUE, and React, etc.), the front-end application is packaged as a whole and integrated into the service entry application;
[0090] Overall packaging: After the target application is packaged, a deployment package containing all necessary resources is generated;
[0091] Resource replication: Copy the generated deployment package to the specified directory of the service entry application to ensure the integrity and accessibility of the resources;
[0092] Independent application window: In the main process management of the service entry application, the independent application window of the target application is created through the independent application window function provided by the service entry application; specifically, the independent application window of the target application is created through the BrowserWindow module of the Electron framework; this method ensures the independence and functional integrity of the target application, while allowing interaction between the service entry application and the target application.
[0093] In addition, the methods for loading and running resources of the independent application window of the target application include: one is to use electron-serve to load and run resources. electron-serve is a concise and powerful library. It provides local HTTP server functions for Electron applications, making dynamic loading and updating of files extremely simple. This method is suitable for applications built with the history routing mode in the front-end application. History is a new feature provided by HTML5 that allows developers to directly change the front-end route, that is, to change the URL address without sending an http request to the back-end; the second is to use the loadFile method to load and run resources. loadFile is a code block used to load a specified path filename. This method is suitable for applications built with the hash routing mode in the front-end application. Hash is a mode that concatenates the path of the front-end route behind the real URL.
[0094] Routing configuration: Configure the routing mode of the target application window through the application window routing configuration function provided by the service portal application; specifically:
[0095] By managing the callback function (such as BrowserWindow.webContents.setWindowOpenHandler) when the main process of the Electron framework opens a new window or tab, and listening to the will-navigate and will-redirect events, the route configuration of the independent application window opening (using the web domain name or URL corresponding to the target application as the configuration condition) is managed. This method ensures the coordination between page navigation within the target application and the service entry application.
[0096] will-redirect: This event is triggered when the browser is about to redirect after the server returns a 301 or 302 redirect. Electron can cancel this event through event.preventDefault() to prevent the redirect from continuing.
[0097] will-navigate: This event is triggered when the user clicks a redirect link or JavaScript sets the window.location.href property before the page redirects. However, this event is not triggered when webContents.loadURL and webContents.back are called. In addition, this event is not triggered when window>location.hash is updated or the user clicks an anchor link.
[0098] Entry configuration: define the access entry of the target application in the service entry application through the independent application entry configuration function provided by the service entry application;
[0099] Overall release and version iteration: The target application is treated as a sub-application or functional module of the service entry application, maintaining its independence and integrity to provide a smooth user experience; and the deployment package in the specified directory and the service entry application are released and updated as a whole. Through the external resource reference (extraResources) in the packaging configuration, ensure that the resources of the target application can be correctly included in the release package of the service entry application.
[0100] Advantages and application scenarios: This solution is suitable for applications that are developed using a front-end and back-end separation method and are highly independent. By protecting the independence and functional integrity of the application, the Web application code can be highly reused. At the same time, by localizing the application's static resources, the application's loading efficiency is improved, thereby improving user experience and satisfaction.
[0101] Step 5: deploy and publish the service portal application on the web side and package and publish it on the PC client side across platforms.
[0102] Figure 2 This is a schematic diagram of the effect of menu function registration integration in a method of integrating multiple applications into a PC client based on the Electron framework in a specific embodiment of the present invention. As shown in the figure, the work task application registers three menu functions: work tasks, task scheduling, and task dashboard.
[0103] Figure 3 This is a schematic diagram of the menu function registration management interface in solution 1 of a method for integrating multiple applications into a PC client based on the Electron framework in a specific embodiment of the present invention. As shown in the figure, in the menu function registration method of solution 1, the service entry application provides a menu function registration management function module, through which the administrator manages the menu functions of the access service entry application, combines the menus into products, and authorizes the user or enterprise to open it.
[0104] Figure 4 This is a schematic diagram of the effect of integrating the front-end application in the overall packaging method using solution 2 in a method for integrating multiple applications into a PC client based on the Electron framework in a specific embodiment of the present invention. As shown in the figure, the "Conference" entry in the left navigation of the unified service portal application can open the conference management application, and the "Enter Conference" entry in the conference management application opens the video conference application.
[0105] Therefore, the key points of the method for integrating PC clients with multiple applications based on the Electron framework of the present invention include:
[0106] 1. Application of Electron framework: Selecting Electron framework as the development basis allows developers to use Web technologies (HTML, CSS, JavaScript) to build cross-platform desktop applications. This choice reduces the difficulty of development, improves development efficiency, and ensures the cross-platform nature of the application.
[0107] 2. Construction of a unified service entry application: Create a unified service entry application, which is responsible for implementing core functions such as cross-platform packaging, version updates, local storage management, and window management. These functions ensure the stability and scalability of the service entry application, providing a solid foundation for subsequent application integration.
[0108] 3. Integration of core functions: A series of core functions are integrated into the service portal application, including unified registration and login authentication, menu function registration, permission allocation, message system, independent application portal configuration, application window routing configuration function, iframe public container, independent application window and message synchronization channel. The integration of these functions enables the service portal application to achieve unified management and efficient interaction of multiple applications.
[0109] 4. Unified registration, login and authentication: Provide a unified registration and login mechanism for all integrated target applications to ensure the security and consistency of user information. This mechanism effectively prevents unauthorized access and malicious operations, and improves the security of the system.
[0110] 5. Use of iframe public container: Provide a public iframe container to load and display the pages of each application. This design allows each target application to maintain its original independence and functional integrity, while achieving integration and unified management of target applications.
[0111] 6. Message synchronization channel: The PostMessage technology solution is used to solve the browser homology policy restriction problem and ensure the efficient and secure transmission of user information, permission information and other key information between the service entry application and the page in the iframe container. The establishment of this channel ensures the consistency and real-time nature of the data, and improves the user experience and system performance.
[0112] 7. Overall packaging of front-end applications: Through overall packaging, resource replication, creation of independent application windows, and configuration of routing, efficient application integration and high code reuse are achieved.
[0113] The following uses specific examples to illustrate the method of implementing multi-application integrated PC client through two integration solutions.
[0114] Example 1: The work task application product integration adopts solution 1: menu function registration method integration.
[0115] The main function of this product is work task management. It is an independent application that includes tasks creation, task assignment, progress tracking, feedback communication, task scheduling management, and task summary dashboard.
[0116] S101. Create a unified service portal application (see the above description for specific functions);
[0117] S102. Integrate core functions into the service portal application and complete package release (see the above description for specific functions);
[0118] S103: Transform the work task application, access the unified user authentication mechanism, access the user information, permission information message, and other information acquisition channels, complete the overall product development, and release it online;
[0119] S104, menu function registration: the administrator uses the menu function registration function provided by the service portal application to register the three menus of the work task application: work task, task scheduling, and task board, as well as the function information in the menus, into the authority center, and combines the three menus into a work task application;
[0120] S105. The work task application is authorized to be used. The administrator uses the permission center to authorize the use of the work task application for the user or enterprise.
[0121] Example 2: Video conferencing application product, using solution 2: front-end application overall packaging integration
[0122] This product mainly provides users with online video conferencing functions, voice calls, video calls, text chats, sign-in, conference live broadcasts, recording and other functions. It is an independent application product including web, H5 and APP terminals. This example realizes client integration.
[0123] S201. Create a unified service portal application (see the above description for specific functions);
[0124] S202, integrating core functions into the service portal application (see the above description for specific functions);
[0125] S203, video conferencing application construction and access transformation, first access to a unified user authentication mechanism, access to user information, permission information messages, and other information acquisition channels, and secondly, because the video conferencing application needs to interact with the operating system, the video conferencing application itself is also built and developed using the Electron framework to complete product development;
[0126] S204, the video conferencing application is packaged, resources are copied and placed in the specified directory of the service entry application, corresponding resource introduction is created in the service entry application, an independent window of the video conferencing application is created in the main process, and routing rules for opening the window are set;
[0127] S205, configure application entry: configure application entry in the service entry application, and open authorization for users or enterprises through the permission center;
[0128] S206. The service portal application is packaged and released as a whole: After the video conferencing application is moved in, it will exist as a sub-application within the service portal application and will be packaged and iterated together with the service portal application.
[0129] The technical effects of the present invention include the following.
[0130] 1. Improved development efficiency and reusability: By using the Electron framework, developers can use familiar Web technologies (HTML, CSS, JavaScript) to build desktop applications, which greatly reduces the difficulty of development and learning costs. In addition, the Electron framework allows developers to reuse existing Web application code, avoiding repeated development, reducing R&D costs and maintenance costs, and significantly improving code reusability and development efficiency; at the same time, the web side and the desktop client (PC client) can use the same set of entry application projects, using the convenience of Web technology development resources and talent reserves, and can quickly build and integrate multiple applications into a single PC client;
[0131] 2. Enhanced cross-platform and compatibility of applications: By utilizing the cross-platform compatibility of the Electron framework, the solution of the present invention can be run on different operating systems to meet the diverse needs of enterprises; since the Electron framework itself has cross-platform characteristics, the multi-application integrated PC client built on Electron can also run smoothly on different operating systems, including Windows, macOS, and Linux. This cross-platform nature enables the system to easily adapt to different enterprise environments and user needs, enhancing the compatibility and scalability of the system.
[0132] 3. Ensure the independence and integrity of applications: By independently encapsulating each application, independent entrances and windows can be configured for the application, ensuring that the independence and functional integrity of each application can be maintained after integration, ensuring that users can enjoy the original application functions and user experience.
[0133] 4. Improved system security and stability: Through unified registration, login authentication and authority allocation mechanism, the present invention ensures the security and consistency of user information and prevents unauthorized access and malicious operations. At the same time, through functions such as message system and window management, the system can process and respond to various events and requests in a timely manner, improving the stability and reliability of the system.
[0134] 5. Reduced integration and maintenance costs: Due to the use of a unified service portal application design, flexible menu function registration and permission management are provided, which simplifies the application integration process and reduces integration costs. The system has good scalability and maintainability. Enterprises can flexibly adjust and expand system functions according to business needs. It has flexibility and scalability, can adapt to the ever-changing business needs of enterprises, and reduces the cost and difficulty of later maintenance.
[0135] In summary, the present invention has important value and significance for platform-based and medium-sized and large enterprises. It can not only reduce R&D and maintenance costs, but also improve management efficiency and user experience, and promote enterprise digital transformation and information construction.
[0136] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for integrating multiple applications into a PC client based on the Electron framework, characterized in that: The steps include: Step 1. Use the Electron framework to create a unified service entry application; Step 2: Integrate core functions into the service portal application; Step 3: Transform the target application that needs to be integrated into the service portal application through the core function; Step 4: Select the corresponding integration method and integrate the transformed target application into the service entry application through the core function; Step 5: deploy and publish the service portal application on the web side and package and publish it on the PC client side across platforms.
2. The method for integrating multiple applications into a PC client based on the Electron framework as claimed in claim 1, characterized in that: The step 1 specifically includes: Step 11: Use the Electron framework as a development basis, which allows development using Web technologies. Step 12: Use Web technology to build a unified service entry application.
3. The method for integrating multiple applications into a PC client based on the Electron framework as claimed in claim 1, characterized in that: The core functions in step 2 specifically include: Unified registration, login and authentication function: Provide a unified registration and login mechanism for all target applications to be integrated; Menu function registration function: allows each target application to register its own function menu; Permission allocation function: assign corresponding permissions to each target application based on the user's role and identity; Messaging system function: Establish a unified messaging system to deliver messages and notifications between various target applications; Independent application entry configuration function: configure an independent access entry for each target application; Application window routing configuration function: provides routing configuration, allowing the service entry application to manage the opening and closing of windows of each target application; Iframe public container function: provides a public iframe container for loading and displaying pages of various target applications; Independent application window function: Create independent windows for independent applications through the BrowserWindow module; Message synchronization channel function: put the message into the message system, and use the PostMessage function to obtain the message in the message system, which includes user information, permission information and other information.
4. The method for integrating multiple applications into a PC client based on the Electron framework as claimed in claim 3, characterized in that: The step 3 specifically includes: Step 31: Connect the target application to a unified registration and login mechanism through the unified registration and login authentication function provided by the service portal application; Step 32: Connect the target application to the acquisition channel of user information, permission information and other information through the message synchronization channel function provided by the service portal application.
5. The method for integrating multiple applications into a PC client based on the Electron framework as claimed in claim 3, characterized in that: The corresponding integration methods in step 4 include a menu function registration method and a front-end application overall packaging method.
6. The method for integrating multiple applications into a PC client based on the Electron framework as claimed in claim 5, characterized in that: The menu function registration method specifically includes: The administrator uses the menu function registration function provided by the service portal application to register the function page and page function point information of the target application to the permission center of the service portal application for permission management; In the permission center, the administrator manages the permissions of the functions registered by the target application through the permission allocation function provided by the service portal application; According to the user's permissions, the function page of each target application after registration is opened through the iframe public container function provided by the service portal application.
7. The method for integrating multiple applications into a PC client based on the Electron framework as claimed in claim 6, characterized in that: After registering the function page and page function point information of the target application to the permission center of the service entry application for permission management, the method further includes: Based on actual needs, the administrator combines different functions in the permission center of the service portal application to form a function menu set.
8. The method for integrating multiple applications into a PC client based on the Electron framework as claimed in claim 5, characterized in that: The overall packaging method of the front-end application specifically includes: For target applications developed with a front-end framework, the front-end application is packaged as a whole and integrated into the service entry application; After the target application is packaged, a deployment package containing all necessary resources is generated; Copy the generated deployment package to the specified directory of the service entry application; In the main process management of the service entry application, an independent application window of the target application is created through an independent application window function provided by the service entry application; Configure the routing mode of the target application window through the application window routing configuration function provided by the service portal application; Define the access entry of the target application in the service entry application through the independent application entry configuration function provided by the service entry application; The target application is used as a sub-application or functional module of the service entry application, and the deployment package in the specified directory and the service entry application are released and updated as a whole.
9. The method for integrating multiple applications into a PC client based on the Electron framework as claimed in claim 8, characterized in that: The method of loading and running resources of the independent application window of the target application includes: using electron-serve to load and running resources and using loadFile to load and running resources.
10. The method for integrating multiple applications into a PC client based on the Electron framework as claimed in claim 8, characterized in that: The routing mode of configuring the target application window through the application window routing configuration function provided by the service portal application is specifically: By managing the callback function when the main process of the Electron framework opens a new window or tab and listening to the will-navigate and will-redirect events, the route configuration opened for the independent application window is managed.
