Disclosure of Invention
In order to solve the technical problem, the invention provides a copyright information loading method and a copyright information loading device.
In order to achieve the purpose of the invention, the invention provides a copyright information loading method, which comprises the following steps:
detecting a user login state when a web page is opened;
selecting a configuration file from at least one preset configuration file according to the login state of the user;
and reading and displaying the copyright information in the selected configuration file.
Preferably, before the step of detecting the login status of the user when the web page is opened, the method further comprises:
configuring at least one configuration file, wherein the at least one configuration file comprises a default configuration file.
Preferably, the at least one configuration file further includes at least one custom configuration file.
Preferably, the configuration file is an extensible markup language xml file.
Preferably, the step of selecting one profile from at least one preset profile according to the login status of the user includes:
when the user login state is not login, selecting a user-defined configuration file from the at least one configuration file;
and when the user login state is logged in, selecting the default configuration file.
Preferably, the step of selecting one configuration file from at least one preset configuration file according to the login status of the user further comprises:
and when the user login state is not login and the preset configuration file only comprises a default configuration file, selecting the default configuration file.
Preferably, after the step of reading and displaying the copyright information in the selected configuration file, the method further includes:
and receiving a restoring instruction, and deleting part or all of the custom configuration files according to the restoring instruction.
The invention also provides a copyright information loading device, comprising:
the state detection module is used for detecting the login state of the user when the web page is opened;
the configuration selection module is used for selecting one configuration file from at least one preset configuration file according to the login state of the user;
and the information loading module is used for reading and displaying the copyright information in the selected configuration file.
Preferably, the at least one configuration file includes a default configuration file, or the at least one configuration file includes a default configuration file and at least one custom configuration file, and the configuration selection module includes:
the first selection unit is used for selecting a user-defined configuration file from the at least one configuration file when the user login state is not login;
the second selection unit is used for selecting the default configuration file when the user login state is logged in;
and the third selection unit is used for selecting the default configuration file when the user login state is unregistered and the preset configuration file only comprises the default configuration file.
Preferably, the apparatus further comprises:
and the configuration file management module is used for receiving the restoration instruction and deleting part or all of the custom configuration files according to the restoration instruction.
The invention provides a copyright information loading method and a copyright information loading device. The problem that the copyright information cannot be loaded and the copyright information cannot be reconfigured under the influence of the login state is solved, and a stable and friendly web environment is realized.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
Generally, a web system page performs data interaction with the background through restApi. However, when the user does not log in the system, the RestApi request is discarded according to the system management policy, so that the copyright information of the login page cannot be loaded. In addition, when the configuration file is covered due to system upgrade and the like, the user-defined configuration file is lost, reconfiguration is required, and the operation is complicated.
In order to solve the above problem, embodiments of the present invention provide a method and an apparatus for loading copyright information. The user can configure the copyright information of the web page, and when the user does not configure the copyright information, the page displays the copyright information in the default configuration file; after the user performs the user-defined configuration, displaying the copyright information configured by the user by reading the user-defined configuration file; copyright information can also be restored. The invention provides a method and a device for configuring web page copyright information of a virtualization management system.
The invention provides a copyright information loading method, which is applied to a virtualization management system of a B/S framework, copyright information displayed on a Web page can be configured, default copyright information is stored in an xml file, a user logs in a Web management end and carries out user-defined operation on the copyright information by adopting restApi, and a background stores the user-defined copyright information in a new xml configuration file. When a user does not log in the system, the Web end cannot acquire background data through RestApi, and copyright information to be displayed on a login page can be acquired through the method. Meanwhile, the user-defined configuration and the default configuration exist independently, the user-defined configuration file cannot cover the default configuration file, the restoration operation can be carried out, and after the system is upgraded, the configured copyright information cannot be covered, and the reconfiguration is not needed. A method for configuring copyright information of a web page of a virtualization management system realizes the self-definition of the copyright information and correctly loads the copyright information when a login page user does not log in a system state.
The specific process is shown in fig. 1, and comprises the following steps:
step 101, configuring at least one configuration file.
The at least one configuration file comprises a default configuration file. Furthermore, the at least one configuration file also comprises at least one self-defined configuration file, and the self-defined configuration file comprises user-defined copyright information content which can be used for displaying in a non-login state.
The configuration file is an extensible markup language xml file.
Step 102, detecting a user login state when a web page is opened.
And 103, selecting a configuration file from at least one preset configuration file according to the login state of the user.
The method mainly comprises three conditions:
1. when the user login state is not login, selecting a user-defined configuration file from the at least one configuration file;
2. and when the user login state is logged in, selecting the default configuration file.
3. And when the user login state is not login and the preset configuration file only comprises a default configuration file, selecting the default configuration file.
And step 104, reading and displaying the copyright information in the selected configuration file.
And 105, receiving a restoring instruction, and deleting part or all of the custom configuration files according to the restoring instruction.
Optionally, a restore instruction may be further defined, where the restore instruction indicates to delete part or all of the custom configuration files, restore the configuration files, and reserve the default configuration files.
An embodiment of the present invention further provides a copyright information loading method, which includes the following specific implementation processes:
1) the copyright information is configured through a virtualization management system, the configuration information is transmitted to a background through a RestApi mode on a web page, and a configuration device stores the configured copyright information into a user-defined configuration file, wherein the user-defined configuration file is specifically an xml file.
2) When a web end login page is opened, the copyright information reading device cannot acquire data in a RestApi mode because of identity authentication, and the web reads and analyzes a custom configuration file. And if the user-defined configuration file does not exist or the user-defined configuration copyright information does not exist, reading the copyright information in the default configuration file.
3) And the restoring device can perform copyright information restoring operation after a user logs in the system, transmits a command to the background in a RestApi mode, and deletes the user-defined copyright information through the restoring device in the background.
4) And the display device is used for displaying the copyright information acquired by the reading device.
An embodiment of the present invention further provides a copyright information loading apparatus, which has a structure shown in fig. 2 and includes:
a state detection module 201, configured to detect a user login state when a web page is opened;
a configuration selection module 202, configured to select a configuration file from at least one preset configuration file according to the user login state;
and the information loading module 203 is configured to read and display the copyright information in the selected configuration file.
Preferably, the at least one configuration file includes a default configuration file, or the at least one configuration file includes a default configuration file and at least one custom configuration file, and the configuration selection module 202 is configured as shown in fig. 3, and includes:
the first selecting unit 2021 is configured to select a custom configuration file from the at least one configuration file when the user login status is unregistered;
a second selecting unit 2022, configured to select the default configuration file when the user login status is logged in;
the third selecting unit 2023 is configured to select the default configuration file when the user login status is unregistered and the preset configuration file only includes the default configuration file.
Preferably, the apparatus further comprises:
and the configuration file management module 204 is configured to receive a restore instruction, and delete part or all of the custom configuration files according to the restore instruction.
The embodiment of the invention provides a copyright information loading method and a copyright information loading device. The problem that the copyright information cannot be loaded and the copyright information cannot be reconfigured under the influence of the login state is solved, and a stable and friendly web environment is realized.
According to the technical scheme provided by the embodiment of the invention, when the login page is loaded, the web end can directly read and analyze the configuration file to display the copyright information, so that the problem that the copyright information of the login page cannot be loaded because the configured copyright information cannot be acquired by using a RestApi method for identity verification of a system which is not logged in is solved. Meanwhile, the problem that the user-defined configuration file is lost due to the fact that the configuration file is covered due to system upgrading can be avoided. The usability of the web end is enhanced, so that the user experience of the management end of the virtualization management system is more friendly, meanwhile, the configuration method is suitable for various scenes, the reconfiguration is not needed after the system is upgraded every time, and the maintenance cost is reduced.
The copyright information configuration device, the copyright information reading device, the reduction device and the information display device are reasonably designed, a user can customize copyright information, the copyright information can be correctly displayed under the condition that the user does not log in the log-in page, the copyright information can be reduced, the user-defined configuration is always effective when the system is upgraded, the customizable function and the usability of the system are increased, and the system is suitable for more application scenes.
In the embodiment of the invention, the default configuration file and the user-defined configuration file are stored in an xml configuration file mode, and the user-defined configuration file and the default configuration file are independent and cannot be modified and covered. By adopting the method, when the login page is loaded, the web end can directly read and analyze the configuration file to display the copyright information, so that the problem that the copyright information of the login page cannot be loaded because the system is not logged in for identity verification and the RestApi method cannot be used for obtaining the configured copyright information is solved. Meanwhile, the problem that the user-defined configuration file is lost due to the fact that the configuration file is covered due to system upgrading can be avoided, user experience of a management end of the virtualization management system is more friendly and easy once and for all, and reconfiguration is not needed after each system upgrading.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, 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, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.