A front-end project secondary development method, device and medium
By adjusting the code and generating route script files in the front-end project, the problem of inefficient secondary development of front-end framework projects was solved, enabling page replacement and function expansion, reducing costs and improving development efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2026-03-27
AI Technical Summary
Existing front-end framework projects cannot be efficiently developed, especially in projects that do not rely on any platform, making it difficult to replace pages and expand functionality.
By adjusting the initial product code in the Git repository, standard product code is generated. Then, a new folder and script template file are created in the front-end project, and the route configurations are merged and deduplicated to generate secondary route script files, enabling the configuration and generation of secondary development pages.
It enables efficient secondary development of front-end framework projects, supports page replacement and function expansion, reduces development costs, and allows for customized development based on standard products, thereby improving development efficiency.
Smart Images

Figure CN118626071B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to a front-end project secondary development method, device and medium. BACKGROUND
[0002] Secondary development (hereinafter referred to as "secondary development") is to customize and modify the existing software (also known as: standard product), extend the function, and then achieve the desired function. A typical requirement in front-end secondary development is to customize a page according to customer requirements, replace a certain page of the standard product, and not affect the subsequent upgrade of other functions.
[0003] At present, some large companies have a low-code development platform, and according to the needs of different customers, the second targeted development is carried out on the platform. However, there are still many front-end framework projects that do not rely on any platform, such as projects using Vue, Angular, React and other front-end JS frameworks, which still cannot efficiently carry out secondary development. SUMMARY
[0004] The embodiments of the present application provide a front-end project secondary development method, device and medium, which are used to solve the problem that the front-end framework project still cannot efficiently carry out secondary development.
[0005] The embodiments of the present application adopt the following technical solutions:
[0006] On the one hand, the embodiments of the present application provide a front-end project secondary development method, which comprises the following steps: adjusting the initial product code of the front-end project in the Git library to obtain the standard product code; the standard product code can support secondary development; obtaining the standard product code from the Git library, cloning the standard product code, and determining the cloned standard product code as the initial code for secondary development; based on the user customization requirement and the initial code, carrying out secondary development on the specified page of the front-end project to obtain a secondary development page; under the pre-set folder of the front-end project, a file in a specified format is newly created, in the file, the route of the secondary development page is configured according to the specified format to obtain a secondary development route configuration file; the secondary development route configuration file is parsed through a pre-set script template file to generate a secondary development route script file; and the front-end project is re-run to obtain a secondary development front-end project.
[0007] In one example, the adjusting the initial product code of the front-end project to obtain the standard product code specifically includes: creating a file path and a folder for storing a second development routing configuration file under a directory of the front-end project; creating a script template file for parsing the second development routing configuration file; adding a command for generating a second development routing script file at a preset node of the front-end project, so that the parsed second development routing configuration file information is run by running the command, so that a second development routing script file of the front-end project can be generated; establishing a channel for importing the second development routing script file under a preset routing file, so that the second development routing script file can be run; and modifying a Git configuration file to limit the second development page from being upgraded.
[0008] In one example, the creating a script template file for parsing the second development routing configuration file specifically includes: importing each routing corresponding to each functional module of the front-end project, merging the routings to obtain a standard product routing of the front-end project; determining whether a second development routing configuration file exists; if yes, importing the second development routing configuration file into the script template file; traversing the standard product routing based on a second development routing in the second development routing configuration file to merge the second development routing with the standard product routing, de-duplicating the merged routing to obtain a final routing; and generating a routing configuration string for the final routing, so that the routing configuration string is written into a second development routing script file to be generated when a running command is executed.
[0009] In one example, the merging the second development routing with the standard product and de-duplicating the merged routing to obtain the final routing specifically includes: determining a second development parent routing and a standard product parent routing with the same path; merging sub-routings corresponding to the second development parent routing and the standard product parent routing with the same path; de-duplicating the merged sub-routings, retaining the sub-routing of the second development parent routing during the de-duplicating to obtain an updated second development routing; splicing the updated second development routing and the standard product routing to obtain a spliced routing; the second development routing is arranged in front of the standard product routing; and de-duplicating the second development parent routing and the standard product parent routing with the same path for the spliced routing, retaining the second development parent routing during the de-duplicating to obtain the final routing.
[0010] In one example, if the second development routing configuration file does not exist, the standard product routing is processed to generate a standard routing configuration string, and the standard routing configuration string is written into a routing script file to be generated.
[0011] In one example, the parsing of the two-open route configuration file by the preset script template file to generate a two-open route script file specifically includes: determining that the two-open route configuration file exists when determining whether the two-open route configuration file exists, and introducing the two-open route configuration file in the script template file; based on the two-open route in the two-open route configuration file, traversing in the standard product route to merge the two-open route with the standard product route, and removing the duplicate route to obtain a final route; generating a route configuration string for the final route, and writing the route configuration string into the two-open route script file to be generated by running the command.
[0012] In one example, after the re-running of the front-end project to obtain the secondary development project, the method further includes: obtaining an upgraded front-end project when the front-end project is upgraded; and merging the code of the secondary development front-end project with the code of the upgraded front-end project to obtain an upgraded secondary development front-end project.
[0013] In one example, after the re-running of the front-end project to obtain the secondary development front-end project, the method further includes: if the front-end project needs to be secondarily developed for other pages, secondarily developing other pages of the front-end project based on the user customization requirement and the initial code to obtain other secondary development pages; creating an other file in a format agreed under the folder, configuring the route of the other secondary development pages in the other file according to the agreed format to obtain other two-open route configuration files; and parsing the other two-open route configuration files by the script template file to generate other two-open route script files.
[0014] On the other hand, the embodiments of the present application provide a front-end project secondary development device, which includes: at least one processor; and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the above-mentioned front-end project secondary development methods.
[0015] On the other hand, the embodiments of the present application provide a front-end project secondary development nonvolatile computer storage medium, which stores computer executable instructions, and the computer executable instructions can perform any one of the above-mentioned front-end project secondary development methods.
[0016] The above-mentioned at least one technical solution adopted by the embodiments of the present application can achieve the following beneficial effects:
[0017] The initial product code of the front-end project can be adjusted to obtain standard product code, and the standard product code can support secondary development. By reserving a folder for storing secondary development routing configuration files, the routing of the secondary development page is configured according to the agreed format to obtain the secondary development routing configuration file, and the manual generation of the routing is realized. New routing configuration or existing routing configuration can be created or modified according to the customized needs, so as to realize the purpose of adding a new page or replacing a page. The secondary development routing configuration file is parsed by using a pre-set script template file to generate a secondary development routing script file, so that the secondary development routing script can be automatically generated. The method can be applied to the project of the front-end framework, and can also be applied to the customized development of a single project based on the standard product. Further, the method can also realize the customized development of multiple projects at the same time, and greatly reduces the cost of secondary development and improves the efficiency of secondary development. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the present application, some embodiments of the present application will be described in detail below with reference to the accompanying drawings, in which:
[0019] Figure 1 A flowchart of a front-end project secondary development method provided by an embodiment of the present application;
[0020] Figure 2 A structural schematic diagram of a front-end project secondary development device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of the present application more clear, the technical solutions of the present application will be described clearly and completely below with reference to specific embodiments and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0022] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0023] Figure 1 A flowchart of a front-end project secondary development method provided by an embodiment of the present application. The method can be applied to different business fields, such as the Internet financial business field, the e-commerce business field, the instant messaging business field, the game business field, the public service business field, etc. Some input parameters or intermediate results in the flowchart allow manual intervention to adjust to help improve accuracy.
[0024] The implementation of the analysis method related to the embodiments of the present application can be a terminal device or a server, and the present application does not make special limitations thereon. For the convenience of understanding and description, the following embodiments are described in detail taking the server as an example.
[0025] It should be noted that the server can be a single device, or a system composed of multiple devices, i.e., a distributed server, and the present application does not make specific limitations thereon.
[0026] It should be noted that the routing plug-ins used by different front-end frameworks are slightly different, so the codes of different frameworks are slightly different, but the processes are consistent. The present embodiment elaborates the present method in detail by taking the secondary development of a Vue project.
[0027] Figure 1 The process in the above formula includes the following steps.
[0028] S101: In the Git library, the initial product code of the front-end project is adjusted to obtain the standard product code; the standard product code can support secondary development.
[0029] In some embodiments of the present application, the front-end project of the front-end JS framework needs to be adjusted in code, so as to have the ability to support secondary development.
[0030] Based on this, the process of adjusting the initial product code of the front-end project is as follows:
[0031] Under the directory of the front-end project, a file path and folder for storing the secondary development routing configuration file are newly created. That is, a reserved folder is reserved for the secondary development routing configuration file, for example, the file path of the reserved folder is: src / custom / modules.
[0032] A script template file for parsing the secondary development routing configuration file is newly created. That is, in the script template file, the logic process of how to parse the secondary development routing configuration file is included. That is, the script template file is equivalent to a routing parser.
[0033] In the preset node of the front-end project, a command for generating the secondary development routing script file is added, so as to run the parsed secondary development routing configuration file information by running the command, so as to generate a secondary development routing script file of the front-end project. For example, the command "build:router":"node. / src / common / buildRoutes / build.js" is added to the scripts node of package.json.
[0034] Under the preset routing file, a channel is established to introduce the two-open routing script file, so that the two-open routing script file can be run. For example, the preset routing file of the embodiment is src / route.ts, and part of the code is as follows:
[0035] const routesString = require('. / routes.js'); / / Introduce the newly generated two-open routing script file
[0036] const router = new VueRouter({
[0037] mode: 'history',
[0038] routes: routesString / / Configuration
[0039] });
[0040] The Git configuration file is modified to limit the secondary development page from being upgraded. For example, the Gitignore file is modified.
[0041] For example, src / custom / modules /
[0042] src / routes.js
[0043] *.back
[0044] In some embodiments of the application, the logic process included in the script template file is as follows:
[0045] Each route corresponding to each function module of the front-end project is introduced, each route is merged, and the standard product route of the front-end project is obtained. It should be noted that the standard product route includes parent routes and child routes of the parent routes.
[0046] It is judged whether there is a two-open routing configuration file.
[0047] If yes, the two-open routing configuration file is introduced into the script template file.
[0048] Based on the two-open routing in the two-open routing configuration file, the standard product route is traversed to merge the two-open routing with the standard product route, the merged routing is de-duplicated, and the final routing is obtained.
[0049] A routing configuration string is generated for the final routing, so that the routing configuration string is written into the two-open routing script file to be generated when the running command is executed. That is, the parsed two-open routing configuration file information includes the routing configuration string.
[0050] It should be noted that, in the absence of two open routing configuration file, then the standard product routing processing, generating a standard routing configuration string, to write the standard routing configuration string to the generated routing script file.
[0051] In some embodiments of the present application, the two open routes are combined with the standard product routes, and the combined routes are de-duplicated to obtain the final routes, as follows:
[0052] Determine the two open parent routes and the standard product parent routes with the same path.
[0053] Merge the sub-routes corresponding to the two open parent routes and the standard product parent routes with the same path.
[0054] De-duplicate the merged sub-routes, and keep the sub-routes of the two open parent routes during de-duplication to obtain the updated two open routes.
[0055] Splice the updated two open routes and the standard product routes to obtain the spliced routes. The two open routes are in front of the standard product routes. That is, splice into one route. The two open routes are in front of the array, and the standard product routes are behind the array.
[0056] For the spliced routes, de-duplicate the two open parent routes and the standard product parent routes with the same path, and keep the two open parent routes during de-duplication to obtain the final routes.
[0057] In one example, the logical process of the script template file is as follows:
[0058] Create a build.js file under the src / common / buildRoutes directory, and the build.js file is as follows:
[0059] For example, first, import the file processing system provided by the node server, import the routing configuration files of the front-end project order center, user center, news message, etc. module, convert each routing configuration file into an array object through the file processing system, splice these array objects into a whole to obtain the routing array A of the front-end project.
[0060] Second, determine whether there is a two open routing configuration file. If there is, introduce the two open routing configuration file and convert it into a two open routing array B through the file processing system; if not, directly execute the fifth step.
[0061] Third step, double loop for array A and B, outer loop for array A, inner loop for array B. In the loop body, judge whether the current loop object routeitemB of array B contains the child route 'children' object. If so, splice the child route array childrenA of the current loop object routeitemA of A and the child route array childrenB of the current loop object routeitemB of B into childrenC, and traverse the child route object in childrenC to remove duplicates, and keep the last traversal to the child route object when the 'path' attribute is repeated. After removing duplicates, get childrenD, and assign the de-duplicated child route childrenD to childrenB. After the double loop, get the new two-open route array B.
[0062] Fourth step, splice the route array A of the front-end project and the new two-open route array B to get the overall route array C. Traverse array C to remove duplicates, and keep the last traversal to the loop object when the 'path' attribute of the loop object is repeated. After removing duplicates, get the new array C.
[0063] Fifth step, convert the new array C into a json string (convert A into a json string without a two-open route configuration file), and then further splice it with the required code string to process it into a module string D that can be exported.
[0064] Sixth step, use the file processing system to write string D into the script file.
[0065] S102: Obtain the standard product code from the Git library, clone the standard product code, and determine the cloned standard product code as the initial code for secondary development.
[0066] S103: Based on user customization requirements and the initial code, develop the specified page of the front-end project for secondary development, and obtain a secondary development page.
[0067] For example, for example, under the src / custom / directory, create a pages folder to store the secondary development page, create a shopcar folder under pages, and create a shopcar.vue file under shopcar to customize the development of the shopping cart page.
[0068] S104: Under the pre-set folder of the front-end project, create a file in a specified format, and in the file, configure the route of the secondary development page according to the specified format to obtain a two-open route configuration file.
[0069] In one example, a customRoutes.js file is newly created under the src / custom / modules directory, and the route is configured in the file in the agreed format:
[0070] module.exports=[{path:”,name:”,component:"()=>import('xxx.vue')",meta:{}}]。
[0071] S105: The two-open route configuration file is parsed by a preset script template file to generate a two-open route script file.
[0072] In some embodiments of the present application, the parsing process of the two-open route configuration file is as follows:
[0073] First, when determining whether the two-open route configuration file exists, it is determined that the two-open route configuration file exists, and in the script template file, the generated two-open route configuration file is imported.
[0074] Based on the two-open route in the two-open route configuration file, the standard product route is traversed to merge the two-open route with the standard product route, the merged route is de-duplicated, and the final route is obtained.
[0075] A route configuration string is generated for the final route, and the route configuration string is written into the generated two-open route script file by running the command.
[0076] For example, the "npm run build:router" command is run in the command line, and a routes.js file is generated after running.
[0077] It should be noted that how to merge the two-open route with the standard product route and de-duplicate the merged route is described with reference to S101, and will not be described here.
[0078] It should be noted that when the two-open route configuration file does not exist, the standard product route is processed to generate a standard route configuration string, and the standard route configuration string is written into the generated route script file.
[0079] S106: The front-end project is re-run to obtain a secondary development front-end project.
[0080] For example, the project is re-run and the project is previewed, and it can be seen that the two-open newly added page and part of the standard product page are replaced by the two-open page. For example, the original shopping cart page is replaced by the two-open shopping cart page, and the member center page that the standard product does not have is newly added.
[0081] Further, if the front-end project needs to be secondarily developed on other pages, the other pages of the front-end project are secondarily developed based on user customization requirements and initial codes, to obtain other secondarily developed pages.
[0082] Under the folder, a file in a convention format is newly created, in the file, routes of the other secondarily developed pages are configured in the convention format, to obtain other secondarily developed route configuration files.
[0083] The other secondarily developed route configuration files are parsed through the script template file, to generate other secondarily developed route script files.
[0084] It should be noted that the specific secondary development process refers to the development process of the specified page, which will not be described here.
[0085] When the page does not have secondary development, the secondarily developed front-end project is tested, and after the testing of the secondarily developed front-end project is completed, the secondarily developed front-end project is packaged and deployed.
[0086] In some embodiments of the present application, the front-end project has an upgrade case, and the secondarily developed front-end project is upgraded along with the front-end project.
[0087] Specifically, when the front-end project is upgraded, the upgraded standard product code is pulled from the Git library, to obtain an upgraded front-end project.
[0088] The code of the secondarily developed front-end project is merged with the code of the upgraded front-end project, to obtain an upgraded secondarily developed front-end project.
[0089] Thus, the upgraded secondarily developed front-end project can include both secondary development content and upgrade content.
[0090] It should be noted that the secondary development related content in the front-end project cannot be upgraded, that is, by modifying the Git configuration file, the generated route configuration file is ignored, so that the secondary development page is not upgraded.
[0091] It should be noted that although the embodiments of the present application are introduced and described in steps S101 to S106 in sequence with reference to Figure 1 , this does not mean that steps S101 to S106 must be executed in strict sequence. The embodiments of the present application introduce and describe steps S101 to S106 in sequence as shown in Figure 1 , in order to facilitate the understanding of the technical solution of the embodiments of the present application by those skilled in the art. In other words, in the embodiments of the present application, the sequence between steps S101 to S106 can be appropriately adjusted according to actual needs.
[0092] ThroughFigure 1 This method allows for adjustments to the initial product code of a front-end project to obtain standard product code, enabling secondary development. By reserving a folder for storing secondary development route configuration files, routes for secondary development pages are configured according to a pre-defined format, resulting in secondary development route configuration files. This allows for manual route generation, enabling the creation of new route configurations or modification of existing ones based on customization needs, thereby adding or replacing pages. Furthermore, by parsing the secondary development route configuration files using pre-defined script template files, secondary development route script files can be automatically generated. This method is applicable to projects based on front-end frameworks, as well as for customized development of single projects based on the standard product. It also enables simultaneous customized development of multiple projects, significantly reducing secondary development costs and improving efficiency.
[0093] Based on the same idea, some embodiments of this application also provide devices and non-volatile computer storage media corresponding to the above methods.
[0094] Figure 2 A schematic diagram of a front-end project secondary development device provided in this application embodiment includes:
[0095] At least one processor; and,
[0096] A memory communicatively connected to the at least one processor; wherein,
[0097] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform any of the aforementioned front-end project secondary development methods.
[0098] Some embodiments of this application provide a non-volatile computer storage medium for secondary development of front-end projects, which stores computer-executable instructions capable of executing any of the aforementioned methods for secondary development of front-end projects.
[0099] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.
[0100] The device and medium provided by the embodiments of the present application are one-to-one corresponding, and therefore, the device and medium also have similar beneficial technical effects to the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the device and medium will not be described here again.
[0101] Those skilled in the art will appreciate that embodiments of the present application can be supplied as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer usable program code.
[0102] The present application is described with reference to the flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 means for carrying out the functions specified in the flowcharts and / or block diagrams.
[0103] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction means, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 means for carrying out the functions specified in the flowcharts and / or block diagrams.
[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 means for carrying out the functions specified in the flowcharts and / or block diagrams.
[0105] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memories.
[0106] Memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, etc. in the form of a computer-readable medium, read only memory (ROM), or flash memory, etc. Memory is an example of computer-readable media.
[0107] Computer-readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
[0108] It should also be noted that the terms "comprising", "containing", or any other variant thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0109] The above description is only an example of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the technical principles of the present application shall fall within the protection scope of the present application.
Claims
1. A method for secondary development of a front-end project, characterized in that, The method includes: In the Git repository, the initial product code of the front-end project is adjusted to obtain standard product code; the standard product code can support secondary development. Obtain the standard product code from the Git repository, clone the standard product code, and use the cloned standard product code as the initial code for secondary development; Based on user customization requirements and the initial code, a secondary development is performed on a specified page of the front-end project to obtain a secondary development page. In the pre-defined folder of the front-end project, create a file with a predefined format. In this file, configure the routing of the secondary development page according to the predefined format to obtain the secondary development routing configuration file. The secondary routing configuration file is parsed using a pre-defined script template file to generate a secondary routing script file; The front-end project is rerun to obtain a secondary development front-end project; The adjustment of the initial product code of the front-end project to obtain standard product code specifically includes: In the directory of the front-end project, create a file path and folder to store the secondary routing configuration file; Create a new script template file for parsing the secondary routing configuration file; In the preset node of the front-end project, a command for generating a secondary routing script file is added. By running the command, the parsed secondary routing configuration file information is executed to generate a secondary routing script file for the front-end project. Under the preset routing file, a channel is created to import the secondary routing script file so that the secondary routing script file can be run; Modify the Git configuration file to prevent the secondary development page from being upgraded; The creation of a new script template file for parsing the secondary routing configuration file specifically includes: The routes corresponding to each functional module of the front-end project are introduced, and the routes are merged to obtain the standard product routes of the front-end project. Determine if a secondary routing configuration file exists; If so, import the secondary routing configuration file into the script template file; Based on the secondary routes in the secondary route configuration file, the standard product routes are traversed to merge the secondary routes with the standard product routes, and the merged routes are deduplicated to obtain the final routes. Generate a route configuration string for the final route so that it can be written into the secondary route script file to be generated when the command is run; The method further includes: If no secondary routing configuration file exists, the standard product route is processed to generate a standard routing configuration string, which is then written into the routing script file to be generated.
2. The method according to claim 1, characterized in that, The process of merging the secondary routes with the standard product, deduplicating the merged routes, and obtaining the final routes specifically includes: Identify the parent routes of the two-way open-source system and the standard product parent routes that have the same path; Merge the child routes corresponding to the parent routes of the two open routes with the same path and the parent routes of the standard products respectively; The merged sub-routes are deduplicated. During deduplication, the sub-routes of the double-open parent route are retained to obtain the updated double-open route. The updated secondary route is concatenated with the standard product route to obtain a concatenated route; the secondary route is placed before the standard product route. For spliced routes, duplicate parent routes with the same path are deduplicated from the standard product parent route. During deduplication, the duplicate parent routes are retained to obtain the final route.
3. The method according to claim 1, characterized in that, The process of parsing the secondary routing configuration file using a pre-defined script template file to generate a secondary routing script file specifically includes: When performing the process of determining whether a secondary routing configuration file exists, if the secondary routing configuration file is found to exist, the secondary routing configuration file is imported into the script template file; Based on the secondary routes in the secondary route configuration file, the standard product routes are traversed to merge the secondary routes with the standard product routes, and the merged routes are deduplicated to obtain the final routes; Generate a route configuration string for the final route, and write the route configuration string into the secondary route script file to be generated by running the command.
4. The method according to claim 1, characterized in that, After rerunning the front-end project to obtain the secondary development project, the method further includes: When upgrading a front-end project, you will receive the upgraded front-end project information. The code of the secondary development front-end project is merged with the code of the upgraded front-end project to obtain the upgraded secondary development front-end project.
5. The method according to claim 1, characterized in that, After rerunning the front-end project to obtain a secondary development front-end project, the method further includes: If the front-end project requires secondary development of other pages, then based on the user's customized requirements and the initial code, the other pages of the front-end project are further developed to obtain other secondary developed pages; In the folder, create a new file with a predefined format. In this file, configure the routing of the other secondary development pages according to the predefined format to obtain the other secondary development routing configuration file. The script template file is used to parse the other secondary routing configuration files to generate other secondary routing script files.
6. A device for secondary development of front-end projects, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform a front-end project secondary development method as described in any one of claims 1-5.
7. A non-volatile computer storage medium for secondary development of front-end projects, storing computer-executable instructions, characterized in that, The computer-executable instructions are capable of executing the front-end project secondary development method described in any one of claims 1-5.
Citation Information
Patent Citations
Software project development method and device, computer storage medium and computer equipment
CN113448572A