Vue project configuration method and device, electronic equipment and storage medium

By obtaining and replacing the environment configuration files of the Vue project, the problem of time-consuming configuration operations during multi-environment deployment of the Vue project is solved, which improves flexibility, maintainability, security and consistency, simplifies configuration management, and improves development. efficiency and deployment accuracy.

CN118567745APending Publication Date: 2024-08-30BEIJING TEAMSUN TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410629312.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Configuration operations of Vue projects when deployed in multiple environments are time-consuming and inconvenient. The existing technology requires manual modification of a large number of configuration files, which affects development efficiency and deployment accuracy.

Method used

By obtaining and running the packaging command carrying the Vue project execution environment identifier, loading environment files, reading environment variables, obtaining and replacing configuration files in the corresponding environment, dynamic loading and replacement of configuration files is achieved, and configuration management of local and Web servers is supported. .

Benefits of technology

It improves the flexibility and deployment accuracy of Vue projects in different environments, simplifies configuration maintenance, enhances security and consistency, reduces network communication and storage usage, and improves system resource utilization and operating efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567745A
    Figure CN118567745A
Patent Text Reader

Abstract

The embodiment of the invention discloses a Vue project configuration method and device, electronic equipment and a storage medium, and the method is applied to a Web front end, and comprises the steps: obtaining an environment file obtained by loading after a packaging command carrying a Vue project execution environment identifier is operated; reading a Vue project execution environment variable in the environment file, and obtaining a configuration file in a corresponding environment; and replacing the corresponding environment configuration general file in the Vue project file with the obtained configuration file. The technical scheme provided by the embodiment of the invention can be suitable for a scene of Vue project multi-environment deployment, and can solve the problem that the Vue project configuration operation is time-consuming and inconvenient in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a Vue project configuration method, device, electronic device and storage medium. Background Art

[0002] Vue is a JavaScript framework for building user interfaces. It allows developers to use a declarative, componentized programming model to achieve more efficient, flexible, and easy-to-maintain web applications. Due to its high development efficiency, ease of use, and low learning curve, more and more developers choose to use it to develop web applications. Among them, the web application is called a Vue project, and the command line tool Vue-CLI (Vue Command Line Interface) can be used to quickly build and manage Vue projects.

[0003] In the process of Web front-end development, Vue project packaging is a very important link. Through packaging, the performance of the application can be optimized, and the security and reliability of the application can be guaranteed. At the same time, it can also support browser compatibility and adapt to different environments and user needs. After packaging, the source code of the Vue project will be compressed and the files will be renamed, which makes it difficult to modify. Each modification can only be repackaged. To solve this problem, the general practice is to extract relevant configuration information (such as domain name, business configuration, etc.) so that the configuration of the program can be dynamically modified after packaging is completed.

[0004] However, when a Vue project needs to be deployed in different environments (such as development environment, test environment, and field environment), it is necessary to modify the program code and repackage it, or manually modify a large number of configuration files after packaging is completed, which is very time-consuming and inconvenient. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a Vue project configuration method, device, electronic device and storage medium to solve the problem in the prior art that configuration operations are time-consuming and inconvenient when Vue projects are deployed in multiple environments.

[0006] In a first aspect, an embodiment of the present invention provides a Vue project configuration method, which is applied to a Web front end, and the method includes:

[0007] Get the environment file loaded after running the packaging command with the Vue project execution environment identifier;

[0008] Read the Vue project execution environment variables in the environment file and obtain the configuration file in the corresponding environment;

[0009] The obtained configuration file will replace the corresponding environment configuration common file in the Vue project file.

[0010] Furthermore, read the Vue project execution environment variables in the environment file to obtain the configuration files in the corresponding environment, including:

[0011] Traverse the common environment configuration files in the Vue project file: read the name of the traversed common environment configuration file; read the Vue project execution environment variables in the environment file; according to the reading result, obtain the configuration file in the corresponding environment.

[0012] Furthermore, obtain the configuration files for the corresponding environment, including:

[0013] Find the configuration file for the corresponding environment locally;

[0014] If the search is successful, then: determine whether the found configuration file has a modifiable side; if it does, obtain the configuration file in the corresponding environment from the Web server and replace the configuration file found locally;

[0015] If the search fails, the configuration file for the corresponding environment is obtained from the Web server.

[0016] Further, determining whether the found configuration file has a modifiable part includes:

[0017] Identify the variables contained in the found configuration file;

[0018] Based on the identification result, determine whether the found configuration file has a modifiable part.

[0019] Furthermore, obtain the configuration files for the corresponding environment, including:

[0020] Determine whether the Vue project type belongs to the preset target Vue project type;

[0021] If yes, obtain the configuration file in the corresponding environment from the Web server;

[0022] If it does not, search for the configuration file in the corresponding environment locally.

[0023] In a second aspect, an embodiment of the present invention provides a Vue project configuration device, which is applied to a Web front end, and the device includes:

[0024] An environment file acquisition unit, used to acquire an environment file loaded after running a packaging command carrying a Vue project execution environment identifier;

[0025] The configuration file acquisition unit is used to read the Vue project execution environment variables in the environment file and obtain the configuration file in the corresponding environment;

[0026] The configuration file replacement unit is used to replace the corresponding environment configuration common file in the Vue project file with the acquired configuration file.

[0027] Furthermore, the configuration file acquisition unit is used to read the Vue project execution environment variables in the environment file and obtain the configuration file in the corresponding environment, including:

[0028] Traverse the common environment configuration files in the Vue project file: read the name of the traversed common environment configuration file; read the Vue project execution environment variables in the environment file; according to the reading result, obtain the configuration file in the corresponding environment.

[0029] Furthermore, the configuration file acquisition unit is used to acquire the configuration file in the corresponding environment, including:

[0030] Find the configuration file for the corresponding environment locally;

[0031] If the search is successful, then: determine whether the found configuration file has a modifiable side; if it does, obtain the configuration file in the corresponding environment from the Web server and replace the configuration file found locally;

[0032] If the search fails, the configuration file for the corresponding environment is obtained from the Web server.

[0033] Furthermore, the configuration file acquisition unit is used to determine whether the found configuration file has a modifiable part, including:

[0034] Identify the variables contained in the found configuration file;

[0035] Based on the identification result, determine whether the found configuration file has a modifiable part.

[0036] Furthermore, the configuration file acquisition unit is used to acquire the configuration file in the corresponding environment, including:

[0037] Determine whether the Vue project type belongs to the preset target Vue project type;

[0038] If yes, obtain the configuration file in the corresponding environment from the Web server;

[0039] If it does not, search for the configuration file in the corresponding environment locally.

[0040] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the Vue project configuration method described in the first aspect above.

[0041] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more central processing units to implement the Vue project configuration method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] 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.

[0043] Figure 1 A flowchart of a Vue project configuration method provided in Embodiment 1 of the present invention;

[0044] Figure 2 A flowchart of a Vue project configuration method provided in Embodiment 2 of the present invention;

[0045] Figure 3 A flowchart of a Vue project configuration method provided in Embodiment 3 of the present invention;

[0046] Figure 4 A schematic diagram of the structure of a Vue project configuration device provided in Embodiment 4 of the present invention;

[0047] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0049] It should be clear that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] Embodiment 1

[0051] This embodiment provides a Vue project configuration method, which can be executed by a corresponding Vue project configuration device on a Web front end, and is suitable for scenarios where a Vue project is deployed in multiple environments. Figure 1 , the method includes the following steps 101-103.

[0052] Step 101, obtain the environment file loaded after running the packaging command carrying the Vue project execution environment identifier.

[0053] In this step, the Vue project execution environment identifier is added to the packaging command, where the Vue project execution environment can be a development environment, a test environment, or a field environment. After running the packaging command, the corresponding environment file will be automatically loaded according to the Vue project execution environment identifier in the command. Usually, the environment file is stored in the root directory of the Vue project created locally, and the file can be named .env.Vue project execution environment identifier. The environment file records the Vue project execution environment variables. The Vue project configuration device cannot directly read the name of the loaded environment file, but can obtain the execution environment of the Vue project by accessing the variables in the environment file.

[0054] Step 102: Read the Vue project execution environment variables in the environment file to obtain the configuration file in the corresponding environment.

[0055] In specific implementation, the various environment configuration common files in the Vue project file can be traversed: read the name of the traversed environment configuration common file; read the Vue project execution environment variables in the environment file; and obtain the configuration file in the corresponding environment based on the reading result. Among them, the Vue project file is pre-written by the developer for use when the Vue project is executed, including multiple configuration files. These configuration files contain various settings for the project, such as the port of the development server, proxy configuration, code compression options, etc., and the file format can be json, html, css, js, pictures, etc., of which some configuration files are environment configuration common files. These configuration files are common configuration files and can contain settings and options shared by all execution environments in the Vue project.

[0056] Exemplarily, for the environment configuration common file in the Vue project file, the environment configuration common file name and the Vue project execution environment variable value can be merged together to obtain the configuration file name in the corresponding environment, and then based on the obtained configuration file name, the configuration file in the corresponding environment is searched locally or accessed to the Web server.

[0057] Step 103: Replace the corresponding environment configuration general file in the Vue project file with the acquired configuration file.

[0058] The technical solution provided in this embodiment is aimed at Web front-end development and aims to improve development efficiency, flexibility and deployment accuracy. Its beneficial effects are mainly reflected in the following aspects:

[0059] Flexibility: By obtaining the execution environment identifier in the packaging command, the corresponding environment files and configuration files can be loaded according to different execution environments, realizing flexible configuration of the project in different environments; developers can use different configurations in different execution environments as needed to meet the needs of various scenarios;

[0060] Maintainability: Separating the configuration files for different environments and replacing the common files makes configuration maintenance clearer and simpler; developers can manage and maintain the configuration files for each environment separately, avoiding the complexity and potential errors of modifying the configurations of different environments in common files;

[0061] Security: By separating environment configuration files from project files, the security of sensitive configuration information can be better protected; sensitive information can be stored in environment files and loaded during the build process, avoiding the risk of exposing sensitive configuration information in project code;

[0062] Scalability: This solution allows you to easily add new execution environments and corresponding configuration files. If you need to add a new environment to an existing project, you only need to create the corresponding environment file and configuration file, and update the execution environment identifier in the packaging command to configure the new environment.

[0063] Consistency: By replacing the common files with the configuration files in the corresponding environment, the configuration of each environment is consistently applied to the project files during the build process; this can avoid unexpected behaviors and errors caused by inconsistent configurations in different environments and improve the stability and reliability of the system.

[0064] Embodiment 2

[0065] This embodiment is based on the above embodiment 1, and further optimizes the step of "obtaining the configuration file under the corresponding environment" to provide a Vue project configuration method. Figure 2 The method includes steps 201 to 208.

[0066] Step 201, obtain the environment file loaded after running the packaging command carrying the Vue project execution environment identifier.

[0067] Step 202: Read the Vue project execution environment variables in the environment file.

[0068] Step 203: Search the local computer for the configuration file in the corresponding environment. If the search succeeds, execute step 204; if the search fails, execute step 207.

[0069] Step 204: Determine whether the found configuration file has a modifiable part. If yes, execute step 205; if no, execute step 206.

[0070] In this step, you can determine whether the found configuration file has a modifiable method by:

[0071] Check file permissions: Check the permission settings of the configuration file. If the configuration file is set to read-only permission, it is determined that there is no modifiable party;

[0072] Check the file location: Check whether the configuration file is located in a non-modifiable protected directory. If so, it is determined that there is no modifiable method.

[0073] Verify file integrity: Use technologies such as file checksum or digital signature to verify file integrity; if the checksum and / or digital signature of the configuration file do not match, it means that the file content has been tampered with and it is determined that there is a modifiable party.

[0074] Preferably, it is possible to determine whether the found configuration file has a modifiable side by accessing and analyzing the file content. Specifically, the variables contained in the found configuration file are identified; and based on the identification result, it is determined whether the found configuration file has a modifiable side. If the found configuration file contains the set modifiable variables, it is determined that the found configuration file has a modifiable side; otherwise, it does not have a modifiable side.

[0075] Step 205 , obtain the configuration file in the corresponding environment from the Web server, replace the configuration file found locally, and execute step 206 .

[0076] Step 206: Use the locally found configuration file as the final configuration file for the corresponding environment. Execute step 208.

[0077] Step 207: Obtain the configuration file in the corresponding environment from the Web server. Execute step 208.

[0078] Step 208: Replace the corresponding environment configuration general file in the Vue project file with the acquired configuration file.

[0079] It should be noted that, in this embodiment, the configuration files of various Vue projects in different execution environments can be uniformly managed by the Web server. For any Vue project, after the Web front end accesses the Web server to obtain the configuration file of an execution environment of this Vue project, it can store it locally or update the existing configuration file of this execution environment of this Vue project locally.

[0080] The technical solution provided in this embodiment has the following advantages:

[0081] Optimize resource utilization and efficiency: Only when the configuration file cannot be found locally or is found but may have been modified, the configuration is obtained from the Web server. This on-demand acquisition method reduces unnecessary network communication and storage usage, and improves system resource utilization and operating efficiency.

[0082] Improve configuration consistency: When a configuration file is found locally but the file has conditions that can be modified, the latest configuration is obtained from the Web server for replacement, ensuring that the configuration used by all front-end instances is consistent with the back-end, avoiding errors and problems caused by inconsistent configuration, and enhancing system stability;

[0083] Enhanced security and controllability: Centralized management of configuration files on the Web server can implement stricter access control and audit processes to ensure that only authorized users can modify the configuration, effectively preventing illegal tampering of configuration information and improving the security level of the system.

[0084] Embodiment 3

[0085] This embodiment is based on the above embodiment 1, and further optimizes the step of "obtaining the configuration file under the corresponding environment" to provide a Vue project configuration method. Figure 3 The method includes steps 301 to 307.

[0086] Step 301, obtain the environment file loaded after running the packaging command carrying the Vue project execution environment identifier.

[0087] Step 302: Read the Vue project execution environment variables in the environment file.

[0088] Step 303: Determine whether the Vue project type belongs to the preset target Vue project type. If yes, execute step 304; if no, execute step 305.

[0089] In actual development, if a Vue project has a large number of configuration files in different execution environments or the content is complex, for example, it contains complex business logic configuration, a large number of environment variables, database connection strings, third-party service credentials, etc., integrating these configuration files directly into the Web front end will significantly increase the size of the Vue project, affecting the loading speed and performance, especially on mobile devices, where large packages have a positive impact on user experience. In addition, if a Vue project contains sensitive information in the configuration files of different execution environments, there will be security risks if it is directly stored in the Web front end.

[0090] In view of the above situation, this embodiment defines the above two types of Vue projects as target Vue project types, and adopts a strategy of dynamically loading configuration files from the Web server. This strategy avoids directly deploying the target Vue project on the Web front end, and instead seeks remote storage. The background uniformly manages the configuration files of these two types of Vue projects in various execution environments, which will not occupy a large amount of resources on the Web front end, and can protect the security of sensitive information and improve user experience. Among them, the target Vue project type can be pre-set by a technician in this field and then configured on the Web front end, or it can be determined by the Web server and then sent to the Web front end.

[0091] Specifically, the steps for the Web server to determine the target Vue project type may include:

[0092] (1) Determine the first target Vue project type

[0093] Evaluate the total number and complexity of configuration files of the Vue project in different execution environments; if the total number of configuration files exceeds a set threshold, or the dependencies and logical relationships between the configuration files reach a set complexity, determine the Vue project type as the first target Vue project type;

[0094] (2) Determine the second target Vue project type

[0095] Create a list of sensitive information keywords, including but not limited to the following keywords: database connection information, API keys, access tokens, passwords, such as "password", "key", "secret", "token", "api_key", "private_key", "access_token", "auth", "credentials", etc.;

[0096] Use automated scripts, text analysis tools, or regular expressions to scan the configuration file names of Vue projects in different execution environments to find out whether they contain keywords in the sensitive information keyword list:

[0097] If yes, the Vue project type is determined as the second target Vue project type;

[0098] If not, scan the configuration file contents of the Vue project in different execution environments to find out whether they involve keywords in the sensitive information keyword list: if yes, determine the Vue project type as the second target Vue project type; if not, determine that the Vue project type does not belong to the second target Vue project type.

[0099] Step 304: Obtain the configuration file in the corresponding environment from the Web server. Execute step 306.

[0100] Step 305: Search the local computer for the configuration file in the corresponding environment. Execute step 306.

[0101] Step 306: Replace the corresponding environment configuration general file in the Vue project file with the acquired configuration file.

[0102] This embodiment provides a flexible and automated configuration file management process. For target project types, configuration files can be dynamically obtained from the Web server, which ensures that sensitive information is not exposed on the front end and reduces the storage resource usage of the Web front end. For non-target type projects, local search configuration is also supported to meet the needs of rapid development and debugging.

[0103] Embodiment 4

[0104] This embodiment provides a Vue project configuration device, which is implemented by software and is used to execute the Vue project configuration method described in the embodiment of the present invention. Figure 4 , the device is applied to the Web front end, and specifically includes the following units:

[0105] The environment file acquisition unit 401 is used to acquire the environment file loaded after running the packaging command carrying the Vue project execution environment identifier;

[0106] The configuration file acquisition unit 402 is used to read the Vue project execution environment variables in the environment file and obtain the configuration file under the corresponding environment;

[0107] The configuration file replacement unit 403 is used to replace the corresponding environment configuration general file in the Vue project file with the acquired configuration file.

[0108] Exemplarily, the configuration file acquisition unit 402 is used to read the Vue project execution environment variables in the environment file to obtain the configuration file in the corresponding environment, including:

[0109] Traverse the common environment configuration files in the Vue project file: read the name of the traversed common environment configuration file; read the Vue project execution environment variables in the environment file; according to the reading result, obtain the configuration file in the corresponding environment.

[0110] As an implementation manner, the configuration file acquisition unit 402 is used to acquire the configuration file in the corresponding environment, including:

[0111] Find the configuration file for the corresponding environment locally;

[0112] If the search is successful, then: determine whether the found configuration file has a modifiable side; if it does, obtain the configuration file in the corresponding environment from the Web server and replace the configuration file found locally;

[0113] If the search fails, the configuration file for the corresponding environment is obtained from the Web server.

[0114] Exemplarily, the configuration file acquisition unit 402 is used to determine whether the found configuration file has a modifiable part, including:

[0115] Identify the variables contained in the found configuration file;

[0116] Based on the identification result, determine whether the found configuration file has a modifiable part.

[0117] As another implementation, the configuration file acquisition unit 402 is used to acquire the configuration file in the corresponding environment, including:

[0118] Determine whether the Vue project type belongs to the preset target Vue project type;

[0119] If yes, obtain the configuration file in the corresponding environment from the Web server;

[0120] If it does not, search for the configuration file in the corresponding environment locally.

[0121] The Vue project configuration device provided in this embodiment belongs to the same inventive concept as the aforementioned method embodiment. For technical details not described in this embodiment, please refer to the relevant description in the aforementioned method embodiment, which will not be repeated here.

[0122] Figure 5 FIG. 1 is a schematic diagram of the structure of an embodiment of an electronic device of the present invention, which can implement the process of the first embodiment, the second embodiment or the third embodiment of the present invention. Figure 5As shown, the above-mentioned electronic device may include: a shell 51, a processor 52, a memory 53, a circuit board 54 and a power supply circuit 55, wherein the circuit board 54 is arranged inside the space enclosed by the shell 51, and the processor 52 and the memory 53 are arranged on the circuit board 54; the power supply circuit 55 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 53 is used to store executable program codes; the processor 52 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 53, so as to execute the Vue project configuration method described in any of the aforementioned embodiments.

[0123] The specific execution process of the above steps by the processor 52 and the steps further executed by the processor 52 by running the executable program code can be found in the description of the method embodiment of the present invention, which will not be repeated here.

[0124] The electronic device can be an electronic device with data processing capabilities that exists in various forms, such as a server that provides computing services. Its structure is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc.

[0125] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more central processing units to implement the Vue project configuration method described in the above embodiment.

[0126] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0127] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0128] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0129] In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0130] For the convenience of description, the above device is described by dividing the functions into various units / modules. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.

[0131] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0132] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A Vue project configuration method, characterized in that: Applied to a Web front end, the method includes: Get the environment file loaded after running the packaging command with the Vue project execution environment identifier; Read the Vue project execution environment variables in the environment file and obtain the configuration file in the corresponding environment; The obtained configuration file will replace the corresponding environment configuration common file in the Vue project file.

2. The method according to claim 1, characterized in that Read the Vue project execution environment variables in the environment file and obtain the configuration files in the corresponding environment, including: Traverse the common environment configuration files in the Vue project file: read the name of the traversed common environment configuration file; read the Vue project execution environment variables in the environment file; according to the reading result, obtain the configuration file in the corresponding environment.

3. The method according to claim 1, characterized in that Get the configuration files for the corresponding environment, including: Find the configuration file for the corresponding environment locally; If the search is successful, then: determine whether the found configuration file has a modifiable side; if it does, obtain the configuration file in the corresponding environment from the Web server and replace the configuration file found locally; If the search fails, the configuration file for the corresponding environment is obtained from the Web server.

4. The method according to claim 3, characterized in that Determine whether the found configuration file has a modifiable part, including: Identify the variables contained in the found configuration file; Based on the identification result, determine whether the found configuration file has a modifiable part.

5. The method according to claim 1, characterized in that Get the configuration files for the corresponding environment, including: Determine whether the Vue project type belongs to the preset target Vue project type; If yes, obtain the configuration file in the corresponding environment from the Web server; If it does not, search for the configuration file in the corresponding environment locally.

6. A Vue project configuration device, characterized in that: Applied to the Web front end, the device includes: An environment file acquisition unit, used to acquire an environment file loaded after running a packaging command carrying a Vue project execution environment identifier; The configuration file acquisition unit is used to read the Vue project execution environment variables in the environment file and obtain the configuration file in the corresponding environment; The configuration file replacement unit is used to replace the corresponding environment configuration common file in the Vue project file with the acquired configuration file.

7. The device according to claim 6, characterized in that The configuration file acquisition unit is used to read the Vue project execution environment variables in the environment file and obtain the configuration files in the corresponding environment, including: Traverse the common environment configuration files in the Vue project file: read the name of the traversed common environment configuration file; read the Vue project execution environment variables in the environment file; according to the reading result, obtain the configuration file in the corresponding environment.

8. The device according to claim 6, characterized in that The configuration file acquisition unit is used to acquire the configuration file in the corresponding environment, including: Find the configuration file for the corresponding environment locally; If the search is successful, then: determine whether the found configuration file has a modifiable side; if it does, obtain the configuration file in the corresponding environment from the Web server and replace the configuration file found locally; If the search fails, the configuration file for the corresponding environment is obtained from the Web server.

9. The device according to claim 8, characterized in that The configuration file acquisition unit is used to determine whether the found configuration file has a modifiable part, including: Identify the variables contained in the found configuration file; Based on the identification result, determine whether the found configuration file has a modifiable part.

10. The device according to claim 6, characterized in that The configuration file acquisition unit is used to acquire the configuration file in the corresponding environment, including: Determine whether the Vue project type belongs to the preset target Vue project type; If yes, obtain the configuration file in the corresponding environment from the Web server; If it does not, search for the configuration file in the corresponding environment locally.

11. An electronic device, characterized in that: The electronic device includes: a shell, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the Vue project configuration method described in any one of the above claims 1-5.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more central processing units to implement the Vue project configuration method described in any of the above claims 1-5.