CN113392346A - Path processing method and device for resource file, electronic equipment and storage medium - Google Patents
Path processing method and device for resource file, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN113392346A CN113392346A CN202110668207.6A CN202110668207A CN113392346A CN 113392346 A CN113392346 A CN 113392346A CN 202110668207 A CN202110668207 A CN 202110668207A CN 113392346 A CN113392346 A CN 113392346A
- Authority
- CN
- China
- Prior art keywords
- path
- resource file
- absolute
- resource
- relative
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 18
- 238000012545 processing Methods 0.000 claims abstract description 47
- 238000000034 method Methods 0.000 claims abstract description 39
- 238000004806 packaging method and process Methods 0.000 claims description 21
- 238000004590 computer program Methods 0.000 claims description 11
- 230000008569 process Effects 0.000 abstract description 14
- 238000011161 development Methods 0.000 abstract description 7
- 238000010586 diagram Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000012858 packaging process Methods 0.000 description 1
- 238000012856 packing Methods 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9558—Details of hyperlinks; Management of linked annotations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/972—Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The disclosure provides a path processing method and device for a resource file, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: acquiring a first absolute path of each resource file of a webpage item; carrying out serialization processing on the first absolute path according to a preset processing rule to obtain a second absolute path; determining a common path of each resource file based on the preconfigured domain name information and the second absolute path; and replacing the relative path in the resource files containing the relative path in each resource file with a common path. According to the technical scheme, the problem of the relative path does not need to be considered in the early-stage project development process, the data packet which does not contain the resource file of the relative path is automatically generated after the project is packaged, the workload of modifying the relative path is reduced, and the risk of omission or error is avoided.
Description
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to the field of web page processing.
Background
With the development of computer technology and network technology, the life style of people is changed by the internet, and people can obtain various information by logging in various websites to meet the requirements of daily life.
When a webpage is put to a third-party platform corresponding to each website for operation, in order to ensure safety, the third-party platform checks the rule of the link of the webpage, performs logic modification (for example, changes the path of a resource file and the like) on the link which does not meet the requirement of the rule, and then generates a new link for putting. Therefore, in order to meet the requirements of the third-party platform, a relative path cannot be provided in the webpage launched to the third-party platform, however, because the relative path is simple to operate, most resource files in the project development use the relative path, if the workload of manual change one by one is too large, and omission or errors are easy to occur, how to efficiently change the relative path of the resource files in the project becomes a problem to be solved.
Disclosure of Invention
The disclosure provides a path processing method and device for a resource file, electronic equipment and a storage medium.
According to an aspect of the present disclosure, there is provided a method for processing a path of a resource file, the method being applied to a packaging tool of a web page project, the method including:
acquiring a first absolute path of each resource file of a webpage item;
carrying out serialization processing on the first absolute path according to a preset processing rule to obtain a second absolute path;
determining a common path of each resource file based on the preconfigured domain name information and the second absolute path;
and replacing the relative path in the resource files containing the relative path in each resource file with a common path.
According to another aspect of the present disclosure, there is provided a path processing apparatus for a resource file, the apparatus being applied to a packaging tool for a web page project, the apparatus including:
the acquisition module is used for acquiring a first absolute path of each resource file of the webpage item;
the processing module is used for carrying out serialization processing on the first absolute path according to a preset processing rule to obtain a second absolute path;
the determining module is used for determining a public path of each resource file based on the preconfigured domain name information and the second absolute path;
and the replacing module is used for replacing the relative path in the resource files containing the relative path with the common path.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method according to any one of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform a method in any of the embodiments of the present disclosure.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method in any of the embodiments of the present disclosure.
The technical scheme of the disclosure solves the problems that the workload of manually changing the relative paths of the resource files one by one is large, and omission or errors are easy to occur. According to the technical scheme, in the process of packaging the resource files in the webpage project by using the packaging tool, the public path is used for uniformly replacing the relative path in each resource file, so that the webpage put on the third-party platform does not contain the relative path, the problem of the relative path does not need to be considered in the early-stage project development process, the data packet which does not contain the resource files of the relative path is automatically generated after the project is packaged, the workload of modifying the relative path is reduced, and the risk of missing or making mistakes is avoided.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a diagram illustrating a path processing method for a resource file according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating a path processing method for a resource file according to an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating a path processing apparatus for a resource file according to an embodiment of the present disclosure;
fig. 4 is a block diagram of an electronic device for implementing a path processing method of a resource file according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The technical scheme of the disclosure can be applied to a packaging tool of webpage items, such as webpack and the like. In the process of packaging the resource files in the webpage project by using the packaging tool, the relative path in each resource file is uniformly replaced by using the public path, and the package which does not contain the resource files of the relative path is automatically generated after the project is packaged, can be directly delivered to a third-party platform, and meets the requirement that the third-party platform does not allow the resource files of the webpage project to have the relative path.
The execution subject of the present disclosure may be any electronic device, for example, a terminal device installed with a packaging tool for a web page item, or the like. The path processing method of the resource file in the embodiment of the present disclosure will be described in detail below.
Fig. 1 is a schematic diagram of a path processing method for a resource file in an embodiment of the present disclosure. The method can be applied to a packaging tool of the webpage item, and as shown in fig. 1, the method can include:
step S101, acquiring a first absolute path of each resource file of a webpage item;
the resource files may include, but are not limited to, various types of files that may be included in a web page such as text, images, audio, video, etc. The first absolute path may be configured according to particular needs.
Step S102, the first absolute path is serialized according to a preset processing rule to obtain a second absolute path;
therein, the Serialization (Serialization) process is a process of converting state information of an object into a form that can be stored or transmitted. During serialization, the object writes its current state to a temporary or persistent store. The object may later be recreated by reading or deserializing the state of the object from storage.
The preset processing rules may be determined according to specific configuration files, and the serialization processing rules corresponding to different configuration files may be different.
Step S103, determining a public path of each resource file based on the preconfigured domain name information and the second absolute path;
based on the domain name information and the second absolute path, a uniform public path can be obtained, and the uniform public path can be used for replacing a relative path in each resource file in the subsequent step. Wherein the domain name information may be preconfigured.
And step S104, replacing the relative path in the resource files containing the relative path in each resource file with a common path.
Wherein the relative path is a path relative to the current file. If the webpage contains the relative path, the third-party platform cannot confirm the safety of the webpage, so that the relative path of each resource file is uniformly replaced by the public path to meet the requirements of the third-party platform.
According to the path processing method for the resource files, the relative path in each resource file is uniformly replaced by the public path in the process of packaging the resource files in the webpage project by using the packaging tool, so that the webpage put on the third-party platform does not contain the relative path, the problem of the relative path does not need to be considered in the early-stage project development process, the data packet which does not contain the resource files of the relative path is automatically generated after the project is packaged, the workload of modifying the relative path is reduced, and the risk of omission or error is avoided.
For a specific implementation of step S101, see the following embodiments.
In one possible implementation manner, obtaining a first absolute path of each resource file of a web page item includes:
and receiving a first absolute path which is pre-configured when the webpage item is a landing page item under the Vue frame, and adding the first absolute path to a first configuration file in the landing page item by using a node js script language, wherein the first configuration file is env.
Vue is a set of progressive frameworks for building user interfaces. Landing pages, which may also be referred to as landing pages, guide pages, may be web pages that a user clicks on an advertisement or searches with a search engine and then displays to the user, and typically displays expanded content related to the clicked advertisement or search result link.
Js is an event-driven I/O server JavaScript running environment, and the V8 engine is based on a Google Chrome V8 engine, so that the Javascript execution speed is high, and the performance is good.
The first variable configuration file may be a configuration file located at a project entry, and the first absolute path received from node.
For a specific implementation of step S102, see the following embodiments.
In a possible implementation manner, performing serialization processing on the first absolute path according to a preset processing rule to obtain a second absolute path includes:
serializing the first absolute path according to a processing rule corresponding to the first configuration file through the first configuration file to obtain a processed first absolute path;
and serializing the processed first absolute path according to a processing rule corresponding to a second configuration file through the second configuration file in the landing page project to obtain a second absolute path, wherein the second configuration file is vue.
The first configuration file and the second configuration file respectively correspond to processing rules, and the first absolute path is correspondingly processed according to the respective corresponding processing rules so as to conform to the processing process of the packaging tool under the Vue framework.
For a specific implementation of step S103, see the following examples.
In one possible implementation, determining a common path for each resource file based on the preconfigured domain name information and the second absolute path includes:
and splicing the preconfigured domain name information and the second absolute path to obtain a public path.
In practical application, the second absolute path is spliced behind the preconfigured domain name information to obtain a uniform common path of each resource file in the project, and the uniform common path can be used for replacing a relative path in each resource file in the subsequent step.
For a specific implementation of step S104, see the following embodiments.
In a possible implementation manner, for resource files including a relative path in each resource file, replacing the relative path in the resource files with a common path includes:
assigning a publicpath attribute in a packaging tool by using a public path to obtain an attribute value;
and replacing the relative path in the resource files containing the relative path in each resource file with an attribute value.
In practical application, public paths are used for assigning values to publicpath attributes to obtain attribute values of the publicpath attributes, for resource files containing relative paths, the attribute values of the publicpath attributes are used for replacing the relative paths in the resource files, and for resource files not containing the relative paths, replacement operation is not required. After the project is packaged, a data packet which does not contain the resource file of the relative path is automatically generated, the workload of modifying the relative path is reduced, and the risk of omission or error is avoided.
In a possible implementation manner, for a resource file including a relative path in each resource file, replacing the relative path therein with an attribute value includes:
traversing each resource file in each resource file, and determining whether an access path of the resource file contains a specific character;
and for the resource file containing the specific character in the access path, replacing the position corresponding to the specific character in the access path by using the attribute value.
In practical application, each resource file in the resource files of the web page project is traversed, each resource file has an access path, and the resource file can be accessed according to the access path. Identifying whether a specific character is contained in an access path of the resource file, wherein the specific character is used for indicating that the access path is a relative path, and the specific character can include but is not limited to./, if the access path contains the specific character, the access path of the resource file is indicated to be the relative path, and replacing a position corresponding to the specific character in the access path of the resource file, namely a position corresponding to the relative path, with an attribute value of a publicpath attribute, so as to obtain a data packet of the resource file which does not contain the relative path.
The following describes an implementation process of the path processing method for a resource file in the present disclosure by using a specific embodiment. Fig. 2 is a schematic diagram of a path processing method for a resource file according to an embodiment of the disclosure.
In this embodiment, the packing tool is webpack. As shown in fig. 2, the method in this embodiment includes:
step S201, adding a preconfigured first absolute path to an env.config.js file in the landing page item using a node.js scripting language;
step S202, serializing the first absolute path according to a processing rule corresponding to the first configuration file through an env.config.js file to obtain a processed first absolute path;
step S203, serializing the processed first absolute path according to a processing rule corresponding to a second configuration file through a vue.config.js file to obtain a second absolute path;
step S204, splicing the domain name information and the second absolute path to obtain a public path;
step S205, assigning a publicpath attribute in webpack by using a public path;
step S206, traversing each resource file in each resource file, and determining whether an access path of the resource file contains a specific character;
step S207, for the resource file having the access path including the specific character, replacing the position corresponding to the specific character in the access path of the resource file with the attribute value of the publicpath attribute.
According to the path processing method for the resource files, the relative path in each resource file is uniformly replaced by the public path in the process of packaging the resource files in the webpage project by using the packaging tool, so that the webpage put on the third-party platform does not contain the relative path, the problem of the relative path does not need to be considered in the early-stage project development process, the data packet which does not contain the resource files of the relative path is automatically generated after the project is packaged, the workload of modifying the relative path is reduced, and the risk of omission or error is avoided.
Fig. 3 is a schematic diagram of a path processing apparatus for a resource file according to an embodiment of the disclosure. The device is applied to a packaging tool of a webpage item, and as shown in fig. 3, the device may include:
an obtaining module 301, configured to obtain a first absolute path of each resource file of a web page item;
a processing module 302, configured to perform serialization processing on the first absolute path according to a preset processing rule to obtain a second absolute path;
a determining module 303, configured to determine a common path of each resource file based on preconfigured domain name information and the second absolute path;
and a replacing module 304, configured to replace, for a resource file including a relative path in each resource file, the relative path in the resource file with a common path.
According to the path processing device for the resource files, the packaging tool is used for uniformly replacing the relative path in each resource file in the packaging process of the resource files in the webpage project, so that the webpage put on the third-party platform does not contain the relative path, the problem of the relative path does not need to be considered in the early-stage project development process, the package which does not contain the resource files of the relative path is automatically generated after the project is packaged, the workload of modifying the relative path is reduced, and the risk of omission or error is avoided.
In a possible implementation manner, the obtaining module 301 is specifically configured to:
and receiving a first absolute path which is pre-configured when the webpage item is a landing page item under the Vue frame, and adding the first absolute path to a first configuration file in the landing page item by using a node js script language, wherein the first configuration file is env.
In a possible implementation manner, the processing module 302 is specifically configured to:
serializing the first absolute path according to a processing rule corresponding to the first configuration file through the first configuration file to obtain a processed first absolute path;
and serializing the processed first absolute path according to a processing rule corresponding to a second configuration file through the second configuration file in the landing page project to obtain a second absolute path, wherein the second configuration file is vue.
In a possible implementation manner, the determining module 303 is specifically configured to:
and splicing the preconfigured domain name information and the second absolute path to obtain a public path.
In one possible implementation, the replacement module 304 includes an assignment unit and a replacement unit;
the assignment unit is used for assigning the publicpath attribute in the packaging tool by using the public path to obtain an attribute value;
and the replacing unit is used for replacing the relative path in the resource files containing the relative path in each resource file with the attribute value.
In a possible implementation manner, the replacing unit is specifically configured to:
traversing each resource file in each resource file, and determining whether an access path of the resource file contains a specific character;
and for the resource file containing the specific character in the access path, replacing the position corresponding to the specific character in the access path by using the attribute value.
The functions of each unit, module or sub-module in each apparatus in the embodiments of the present disclosure may refer to the corresponding description in the above method embodiments, and are not described herein again.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 4 shows a schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the electronic device 400 includes a computing unit 401 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in the electronic device 400 are connected to the I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, or the like; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408 such as a magnetic disk, optical disk, or the like; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.
Claims (10)
1. A path processing method for a resource file is applied to a packaging tool of a webpage project, and comprises the following steps:
acquiring a first absolute path of each resource file of a webpage item;
carrying out serialization processing on the first absolute path according to a preset processing rule to obtain a second absolute path;
determining a common path of each resource file based on preconfigured domain name information and the second absolute path;
and replacing the relative path in the resource files containing the relative path in each resource file with the common path.
2. The method of claim 1, wherein obtaining the first absolute path of each resource file of the web page item comprises:
and receiving a pre-configured first absolute path when the webpage item is a landing page item under an Vue frame, and adding the first absolute path to a first configuration file in the landing page item by using a node.js scripting language, wherein the first configuration file is env.
3. The method according to claim 2, wherein the serializing the first absolute path according to a preset processing rule to obtain a second absolute path comprises:
serializing the first absolute path according to a processing rule corresponding to the first configuration file through a first configuration file to obtain a processed first absolute path;
and performing serialization processing on the processed first absolute path according to a processing rule corresponding to a second configuration file in the landing page project through the second configuration file to obtain a second absolute path, wherein the second configuration file is vue.
4. The method according to any of claims 1-3, wherein the determining the common path for the resource files based on the preconfigured domain name information and the second absolute path comprises:
and splicing the preconfigured domain name information and the second absolute path to obtain the public path.
5. The method according to any one of claims 1 to 3, wherein replacing the relative path with the common path for the resource file containing the relative path in each of the resource files comprises:
assigning values to publicpath attributes in the packaging tool by using the public path to obtain attribute values;
and replacing the relative path in the resource files containing the relative path in each resource file with the attribute value.
6. The method according to claim 5, wherein replacing the relative path with the attribute value for the resource file containing the relative path in each resource file comprises:
traversing each resource file in the resource files, and determining whether an access path of the resource file contains a specific character;
and for the resource file containing the specific character in the access path, replacing the position corresponding to the specific character in the access path by using the attribute value.
7. A path processing device of a resource file, which is applied in a packaging tool of a webpage item, the device comprises:
the acquisition module is used for acquiring a first absolute path of each resource file of the webpage item;
the processing module is used for carrying out serialization processing on the first absolute path according to a preset processing rule to obtain a second absolute path;
a determining module, configured to determine a common path of each resource file based on preconfigured domain name information and the second absolute path;
and the replacing module is used for replacing the relative path in the resource files containing the relative path with the common path.
8. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
9. A non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-6.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110668207.6A CN113392346B (en) | 2021-06-16 | 2021-06-16 | Path processing method and device for resource file, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110668207.6A CN113392346B (en) | 2021-06-16 | 2021-06-16 | Path processing method and device for resource file, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113392346A true CN113392346A (en) | 2021-09-14 |
CN113392346B CN113392346B (en) | 2023-09-12 |
Family
ID=77621473
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110668207.6A Active CN113392346B (en) | 2021-06-16 | 2021-06-16 | Path processing method and device for resource file, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113392346B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114816407A (en) * | 2022-05-24 | 2022-07-29 | 新奥数能科技有限公司 | Component packaging method and device, electronic equipment and storage medium |
CN114935999A (en) * | 2022-06-21 | 2022-08-23 | 中国建设银行股份有限公司 | Webpage copying method, device and equipment |
CN115333836A (en) * | 2022-08-12 | 2022-11-11 | 北京百度网讯科技有限公司 | Processing method and device for verification file, electronic equipment and readable storage medium |
CN116301471A (en) * | 2023-05-18 | 2023-06-23 | 深圳前海环融联易信息科技服务有限公司 | Method for realizing automatic file insertion and automatic file insertion method |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040030741A1 (en) * | 2001-04-02 | 2004-02-12 | Wolton Richard Ernest | Method and apparatus for search, visual navigation, analysis and retrieval of information from networks with remote notification and content delivery |
CN102567373A (en) * | 2010-12-23 | 2012-07-11 | 上海鸣啸信息科技发展有限公司 | Self-service terminal for Jiangsu speedway |
CN108228818A (en) * | 2017-12-29 | 2018-06-29 | 网易(杭州)网络有限公司 | Web page resources loading method and device, electronic equipment and storage medium |
CN108804926A (en) * | 2018-05-23 | 2018-11-13 | 腾讯科技(深圳)有限公司 | A kind of common Web application Hole Detection, restorative procedure and device |
CN111428209A (en) * | 2019-01-10 | 2020-07-17 | 腾讯科技(深圳)有限公司 | Application program obfuscation method and device and storage medium |
CN112149035A (en) * | 2020-09-23 | 2020-12-29 | 网易(杭州)网络有限公司 | Website static resource processing method and device |
CN112181432A (en) * | 2020-10-13 | 2021-01-05 | 普元信息技术股份有限公司 | System for realizing bundle modular packaging processing in ReactNative framework |
CN112230927A (en) * | 2020-09-17 | 2021-01-15 | 贝壳技术有限公司 | File redirection method, code loading control method and device |
CN112260988A (en) * | 2020-09-16 | 2021-01-22 | 厦门网宿有限公司 | Abnormal request processing method and device |
-
2021
- 2021-06-16 CN CN202110668207.6A patent/CN113392346B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040030741A1 (en) * | 2001-04-02 | 2004-02-12 | Wolton Richard Ernest | Method and apparatus for search, visual navigation, analysis and retrieval of information from networks with remote notification and content delivery |
CN102567373A (en) * | 2010-12-23 | 2012-07-11 | 上海鸣啸信息科技发展有限公司 | Self-service terminal for Jiangsu speedway |
CN108228818A (en) * | 2017-12-29 | 2018-06-29 | 网易(杭州)网络有限公司 | Web page resources loading method and device, electronic equipment and storage medium |
CN108804926A (en) * | 2018-05-23 | 2018-11-13 | 腾讯科技(深圳)有限公司 | A kind of common Web application Hole Detection, restorative procedure and device |
CN111428209A (en) * | 2019-01-10 | 2020-07-17 | 腾讯科技(深圳)有限公司 | Application program obfuscation method and device and storage medium |
CN112260988A (en) * | 2020-09-16 | 2021-01-22 | 厦门网宿有限公司 | Abnormal request processing method and device |
CN112230927A (en) * | 2020-09-17 | 2021-01-15 | 贝壳技术有限公司 | File redirection method, code loading control method and device |
CN112149035A (en) * | 2020-09-23 | 2020-12-29 | 网易(杭州)网络有限公司 | Website static resource processing method and device |
CN112181432A (en) * | 2020-10-13 | 2021-01-05 | 普元信息技术股份有限公司 | System for realizing bundle modular packaging processing in ReactNative framework |
Non-Patent Citations (1)
Title |
---|
袁野: "基于Hadoop的在线数据挖掘系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, pages 138 - 634 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114816407A (en) * | 2022-05-24 | 2022-07-29 | 新奥数能科技有限公司 | Component packaging method and device, electronic equipment and storage medium |
CN114935999A (en) * | 2022-06-21 | 2022-08-23 | 中国建设银行股份有限公司 | Webpage copying method, device and equipment |
CN115333836A (en) * | 2022-08-12 | 2022-11-11 | 北京百度网讯科技有限公司 | Processing method and device for verification file, electronic equipment and readable storage medium |
CN115333836B (en) * | 2022-08-12 | 2023-05-30 | 北京百度网讯科技有限公司 | Verification file processing method and device, electronic equipment and readable storage medium |
CN116301471A (en) * | 2023-05-18 | 2023-06-23 | 深圳前海环融联易信息科技服务有限公司 | Method for realizing automatic file insertion and automatic file insertion method |
CN116301471B (en) * | 2023-05-18 | 2023-09-01 | 深圳前海环融联易信息科技服务有限公司 | Method for realizing automatic file insertion and automatic file insertion method |
Also Published As
Publication number | Publication date |
---|---|
CN113392346B (en) | 2023-09-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113392346B (en) | Path processing method and device for resource file, electronic equipment and storage medium | |
CN112506602B (en) | Page generation method and device, electronic equipment and computer readable medium | |
CN112926008A (en) | Method and device for generating form page, electronic equipment and storage medium | |
CN114389969A (en) | Client test method and device, electronic equipment and storage medium | |
CN115509522A (en) | Interface arranging method and system for low-code scene and electronic equipment | |
CN113407745A (en) | Data annotation method and device, electronic equipment and computer readable storage medium | |
CN116302218B (en) | Function information adding method, device, equipment and storage medium | |
CN114741294A (en) | Page debugging method, device, equipment and storage medium | |
CN114218313A (en) | Data management method, device, electronic equipment, storage medium and product | |
CN114386577A (en) | Method, apparatus, and storage medium for executing deep learning model | |
CN113849164A (en) | Data processing method and device, electronic equipment and memory | |
CN113360407B (en) | Function positioning method and device, electronic equipment and readable storage medium | |
CN113239296B (en) | Method, device, equipment and medium for displaying small program | |
CN117270838B (en) | Method, device, equipment and medium for generating universal formula script | |
CN115344801A (en) | Method, device, equipment and medium for updating webpage link | |
CN117411939A (en) | Serialized data analysis method, device, equipment and storage medium | |
CN115373659A (en) | Business system construction method and device, electronic equipment and storage medium | |
CN115202791A (en) | Method and device for determining first screen loading resource, server and storage medium | |
CN114995800A (en) | Project development method and device, electronic equipment and storage medium | |
CN116501284A (en) | Voice control method, device, equipment, storage medium and program product | |
CN113361235A (en) | HTML file generation method and device, electronic equipment and readable storage medium | |
CN115510349A (en) | Browser version switching method, device, equipment and medium | |
CN115328497A (en) | File merging method and device, electronic equipment and readable storage medium | |
CN115600029A (en) | Method, device, system, equipment and storage medium for displaying webpage | |
CN115374010A (en) | Function testing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |