CN117014427A - Cross-domain login method, device, terminal equipment and storage medium - Google Patents
Cross-domain login method, device, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN117014427A CN117014427A CN202311069290.0A CN202311069290A CN117014427A CN 117014427 A CN117014427 A CN 117014427A CN 202311069290 A CN202311069290 A CN 202311069290A CN 117014427 A CN117014427 A CN 117014427A
- Authority
- CN
- China
- Prior art keywords
- login
- information
- domain
- cross
- target
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 235000014510 cooky Nutrition 0.000 claims abstract description 136
- 230000004044 response Effects 0.000 claims abstract description 46
- 230000002159 abnormal effect Effects 0.000 claims description 40
- 238000012545 processing Methods 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 abstract description 24
- 238000011161 development Methods 0.000 abstract description 19
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 4
- 238000012360 testing method Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000007723 transport mechanism Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/08—Protocols specially adapted for terminal emulation, e.g. Telnet
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0815—Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
-
- 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
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the application provides a cross-domain login method, a cross-domain login device, terminal equipment and a storage medium, and belongs to the technical field of financial science and technology. The method comprises the following steps: acquiring a first login account, and calling a login interface according to the first login account to acquire a response header field; analyzing the response header field to obtain corresponding cookie information when the first login account is logged in, and determining corresponding target cross-domain login information when the first login account is logged in according to the first login account and the cookie information; executing the task starting command, obtaining a second login account, and determining target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information; and executing cross-domain login of the task according to the target cookie information. The problem of low joint debugging efficiency between projects in the project development process is solved, so that the joint debugging efficiency in the project development process is improved, and the project development period is shortened.
Description
Technical Field
The present application relates to the technical field of financial science and technology, and in particular, to a method, an apparatus, a terminal device, and a storage medium for cross-domain login.
Background
In the process of project development, the interfaces of joint debugging among projects need login states, the current mode of acquiring the login states in the local environment can be that the login states store user information through cookies, the login states are set by login services in response headers, a browser stores cookies according to the response headers, subsequent requests can automatically carry the cookie login states without manually writing in the request headers, but the scheme has a cross-domain problem, therefore, no login-related processing is carried out in the projects, the login states are manually written in a developer tool of the browser after the test environment acquires the cookies, each time the local project is started in the login modes, development efficiency is reduced, multiple users cannot log in simultaneously in the same browser, login accounts are continuously switched to log in different roles for the joint debugging requirements of some roles, and development efficiency is further reduced.
Disclosure of Invention
The embodiment of the application mainly aims to provide a cross-domain login method, a device, terminal equipment and a storage medium, and aims to solve the problem that the front end has cross-domain login in the process of project development, and the problem that the efficiency of project development is seriously influenced because cross-domain information needs to be acquired again before a program is started each time.
In a first aspect, an embodiment of the present application provides a method for cross-domain login, including:
acquiring a first login account, and calling a login interface according to the first login account to acquire a response header field;
analyzing the response header field to obtain cookie information corresponding to the first login account when logging in, and determining target cross-domain login information corresponding to the first login account and the cookie information when logging in;
executing a task starting command, obtaining a second login account, and determining target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information;
and executing cross-domain login of the task according to the target cookie information.
In a second aspect, an embodiment of the present application provides a device for cross-domain login, including:
the data acquisition module is used for acquiring a first login account and calling a login interface according to the first login account to acquire a response header field;
the data processing module is used for analyzing the response header field to obtain cookie information corresponding to the first login account when the first login account is logged in, and determining target cross-domain login information corresponding to the first login account and the cookie information when the first login account is logged in;
the task starting module is used for executing a task starting command, obtaining a second login account, and determining target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information;
and the cross-domain login module is used for executing cross-domain login of the task according to the target cookie information.
In a third aspect, an embodiment of the present application further provides a terminal device, the terminal device including a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for enabling a connection communication between the processor and the memory, wherein the computer program, when executed by the processor, implements the steps of any of the methods for cross-domain login as provided in the present specification.
In a fourth aspect, embodiments of the present application further provide a storage medium for computer readable storage, wherein the storage medium stores one or more programs executable by one or more processors to implement steps of a method for cross-domain login as provided in the present specification.
The embodiment of the application provides a method, a device, terminal equipment and a storage medium for cross-domain login, wherein the method comprises the steps of obtaining a first login account, and calling a login interface according to the first login account to obtain a response header field; analyzing the response header field to obtain corresponding cookie information when the first login account is logged in, and determining corresponding target cross-domain login information when the first login account is logged in according to the first login account and the cookie information; executing the task starting command, obtaining a second login account, and determining target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information; and executing cross-domain login of the task according to the target cookie information. Therefore, the problem of low project development efficiency caused by the fact that the front end needs to solve the cross-domain problem in the existing project development process is solved, the joint debugging efficiency in the project development process is improved, the project development period is reduced, and the project can be brought on line in advance.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for cross-domain login according to an embodiment of the present application;
FIG. 2 is a flow chart of sub-step S102 of the cross-domain login method of FIG. 1;
FIG. 3 is a schematic diagram of a scenario in which the method for cross-domain login according to the present embodiment is implemented;
fig. 4 is a schematic diagram of a cross-domain login device according to an embodiment of the present application;
fig. 5 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The embodiment of the application provides a cross-domain login method, a device, terminal equipment and a storage medium. The cross-domain login method can be applied to terminal equipment, and the terminal equipment can be electronic equipment such as a tablet personal computer, a notebook computer, a desktop computer, a personal digital assistant, wearable equipment and the like.
Some embodiments of the application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
In the local development process, the interface for joint debugging needs to be in a login state. In the prior art, two modes of acquiring login states in a local environment generally exist, one mode is that a login interface is called to acquire a token and then the token is stored in a local browser, the token is written into a request head when the token is requested each time, and the situation has no cross-domain problem. The login state is set by a cookie storage user information, the browser stores the cookie according to the response header, the subsequent request can automatically carry the cookie login state without manually writing in the request header, but the scheme has a cross-domain problem, so that no login-related processing exists in the project, the login state is processed in a manner that after the cookie is acquired by a test environment, the user information is manually written in a developer tool of the browser, the development efficiency is reduced when the local project is started each time, the simultaneous login of multiple users cannot be realized in the same browser, login accounts are continuously switched to log in different roles according to the joint debugging requirement of some roles, and the development efficiency is lower.
Referring to fig. 1, fig. 1 is a flowchart of a cross-domain login method according to an embodiment of the present application.
As shown in fig. 1, the method for cross-domain login includes steps S101 to S104.
Step S101, a first login account is obtained, and a login interface is called according to the first login account to obtain a response header field.
For example, before the project joint debugging is performed, the first login account and a response header field corresponding to the first login account are created, so that information such as a user login account does not need to be manually filled in each login when the project joint debugging is performed later, and development efficiency is affected.
For example, when performing item joint debugging, it is necessary to test whether data communication between two different types of users is normal, so that two login accounts can be created, and the two login accounts can be respectively called to the login interfaces to respectively obtain corresponding response header fields set-cookies.
In some embodiments, the obtaining the first login account includes: determining the number of login users, and when the number of login users is larger than the preset number, sending a selection instruction so that the user determines a target login user according to the selection instruction; and receiving the target login user, and determining the first login account according to the target login user.
The number of login users is obtained, and when the number of login users is greater than 1, a selection instruction is sent, so that the user determines a target login user from the first login account according to the selection instruction, and further determines a corresponding first login account according to the target login user.
For example, when the project joint debugging front end is started, a plurality of user information exists, if a designated user needs to be determined from the plurality of user information, a selection instruction can be sent, then a popup window is displayed according to the selection instruction, the plurality of user information is displayed, the target login user is determined through selection of the corresponding user information in the popup window, and then the account information corresponding to the target login user is used as the first login account after the target login user is determined.
Step S102, analyzing the response header field to obtain cookie information corresponding to the first login account when the first login account is logged in, and determining target cross-domain login information corresponding to the first login account and the cookie information when the first login account is logged in.
Illustratively, the response header field is parsed to obtain cookie information required by the first login account when logging in, and a mapping relationship is established between the first login account and the cookie information to obtain target cross-domain login information.
In some embodiments, the parsing the response header field obtains cookie information corresponding to the first login account when the first login account is logged in, and determines target cross-domain login information corresponding to the first login account and the cookie information when the first login account is logged in, and specifically referring to fig. 2, step S102 includes: substep S1021 to substep S1023.
Substep S1021, determining initial cross-domain login information.
Illustratively, the initial cross-domain login information that is initially created requires information updates over time or development of project development. Thus, initial cross-domain login information is obtained first.
And step S1022, analyzing the response header field according to the keywords to obtain the cookie information corresponding to the first login account when logging in.
Illustratively, the key words are utilized to analyze the response header fields acquired from the login interface, so as to obtain cookie information corresponding to the first login account when logging in.
For example, if the cookie key field is included in the response header field, the corresponding result of the cookie key can be obtained by parsing the key word cookie key in a regular matching manner, and the result is used as cookie information.
And step S1023, adjusting the initial cross-domain login information according to the first login account and the cookie information, and further determining the corresponding target cross-domain login information during login.
The initial cross-domain login information is illustratively adjusted according to the first login account and the cookie information corresponding to the first login account so as to obtain target cross-domain login information required by currently performing project joint debugging.
In some embodiments, the adjusting the initial cross-domain login information according to the first login account and the cookie information, so as to determine the target cross-domain login information corresponding to the login includes: determining state information corresponding to the first login account from the initial cross-domain login information according to the first login account; and adjusting the initial cross-domain login information by utilizing the cookie information according to the state information to obtain the target cross-domain login information.
The method includes the steps that a first login account is queried in initial cross-domain login information, state information corresponding to the first login account is determined according to a query result, and a mode of adjusting the initial cross-domain login information to obtain target cross-domain login information is further determined according to the state information.
For example, the initial cross-domain login information is stored according to a dictionary form, a first login account is used as a key value, cookie information is used as a value, and then the first login account is used for inquiring in the initial cross-domain login information, so that the state information corresponding to the first login account can be determined to be the existence or nonexistence of the first login account, and when the first login account exists, the value corresponding to the first login account in the initial cross-domain login information is updated by using the cookie information; and when the first login account does not exist, adding the first login information as a new key value into the initial cross-domain login information, so as to obtain the target cross-domain login information.
In some embodiments, the state information includes an abnormal state, an updated state, and a new state, and the adjusting the initial cross-domain login information to obtain the target cross-domain login information according to the state information by using the cookie information includes: when the state information is the abnormal state, executing abnormal operation corresponding to the abnormal state to obtain latest cookie information, and adjusting the initial cross-domain login information by utilizing the latest cookie information to obtain the target cross-domain login information; when the state information is the newly added state, the first login account and the cookie information are added into the initial cross-domain login information, so that the target cross-domain login information is obtained; and when the state information is the updated state, updating information corresponding to the initial cross-domain login information of the first login account according to the cookie information, and further acquiring the target cross-domain login information.
The state information is divided into an abnormal state, an updated state and a newly added state, wherein the abnormal state is used for representing that the required cookie information is lack in a response header field obtained by the first login account or the obtained cookie information does not meet the requirements; the update state is used for representing that the first login account exists in the initial cross-domain login information, but corresponding information in the initial cross-domain login information cannot be used due to time or other reasons, and update is needed; the new state is used for representing that the first login account is not in the initial cross-domain login information, and the first login account and the corresponding cookie information thereof need to be added into the initial cross-domain login information, so that the target cross-domain login information is obtained.
For example, when the state information is in an abnormal state, an abnormal operation corresponding to the abnormal state is performed to obtain the latest cookie information corresponding to the first login account, so that the initial cross-domain login information is adjusted by using the latest cookie information and the first login account to obtain the target cross-domain login information. When the state information is in the new state, the first login account and the corresponding cookie information are added to the initial cross-domain login information. And when the state information is in an updating state, updating the information corresponding to the first login account in the initial cross-domain login information into cookie information.
In some embodiments, when the state information is the abnormal state, executing an abnormal operation corresponding to the abnormal state to obtain the latest cookie information, including: transmitting an instruction for re-executing and acquiring the cookie information according to the abnormal state, and acquiring a corresponding latest response header field; and resolving according to the latest response header field to obtain the latest cookie information.
When the state information is in an abnormal state, the obtaining operation is re-executed to the login interface again, so that the latest response header field corresponding to the first login account is obtained, and the latest response header field is analyzed according to the keywords to obtain the latest cookie information.
Step S103, executing a task starting command, obtaining a second login account, and determining target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information.
The task starting command is executed, a second login account corresponding to the task is obtained, and target cookie information corresponding to the second login account is obtained according to the target cross-domain login information.
In some embodiments, the determining, according to the second login account and the target cross-domain login information, the target cookie information corresponding to the second login account includes: according to the second login account, information inquiry is carried out from the target cross-domain login information to obtain a target identifier and a target password corresponding to the second login account; and determining the target cookie information according to the target identifier and the target password.
The target cross-domain login information is in a dictionary form, the second login account is used as a key value, and then a target identifier and a target password corresponding to the second login account are obtained by inquiring the target cross-domain login information, so that target cookie information corresponding to the second login account is determined according to the target identifier and the target password.
For example, the target cross-domain login information is a local environment variable file, login account information supported in the execution task is obtained by reading the local environment variable file, and sessionId and cookie Key corresponding to the second login account are obtained, so that target cookie information corresponding to the second login account is determined according to the sessionId and the cookie Key.
And step S104, executing cross-domain login of the task according to the target cookie information.
The target cookie information corresponding to the second login account is obtained from the target cross-domain login information, so that the cross-domain login of the executed task is realized according to the target cookie information, and the cross-domain login efficiency and the joint debugging efficiency in the project development process are improved.
Referring to fig. 3, fig. 3 is a schematic diagram of a scenario for implementing the cross-domain login method provided in this embodiment, as shown in fig. 3, a cross-domain login information flow corresponding to a user account is first executed to determine whether a file storing target cross-domain login information exists, if not, a prompt is sent out to create a reminder, if yes, whether the acquired login user is a single user is determined, if not, a target login user is selected from a plurality of users, further, a set-cookie of a response header is obtained by calling a login interface according to the target login user, the set-cookie is analyzed to obtain cookie information, state information of the cookie information is determined, and if the state information is an abnormal state, abnormality is thrown out; and when the state information is not in an abnormal state, according to the local variable file corresponding to the read cross-domain login information, if the first login account exists in the local variable file, covering the information corresponding to the first login account, and if the first login account does not exist in the local variable file, newly adding the first login account information, and further obtaining an updated local file. After the process of acquiring the cross-domain information corresponding to the user account is executed, starting the local service, acquiring the second login account and acquiring cookie information corresponding to the second login account from the local file, so as to realize cross-domain login.
Referring to fig. 4, fig. 4 is a cross-domain login device 200 according to an embodiment of the present application, where the cross-domain login device 200 includes: the system comprises a data acquisition module 201, a data processing module 202, a task starting module 203 and a cross-domain login module 204, wherein the data acquisition module 201 is used for acquiring a first login account and calling a login interface according to the first login account to acquire a response header field; the data processing module 202 is configured to parse the response header field to obtain cookie information corresponding to the first login account when the first login account is logged in, and determine target cross-domain login information corresponding to the first login account and the cookie information when the first login account is logged in; the task starting module 203 is configured to execute a task starting command, obtain a second login account, and determine target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information; and the cross-domain login module 204 is used for executing cross-domain login of the task according to the target cookie information.
In some embodiments, the data obtaining module 201 performs, in the process of obtaining the first login account:
determining the number of login users, and when the number of login users is larger than the preset number, sending a selection instruction so that the user determines a target login user according to the selection instruction;
and receiving the target login user, and determining the first login account according to the target login user.
In some embodiments, the data processing module 202 performs, in the process of parsing the response header field to obtain cookie information corresponding to the first login account when logging in, and determining target cross-domain login information corresponding to the first login account when logging in according to the first login account and the cookie information, the steps of:
determining initial cross-domain login information;
analyzing the response header field according to the keywords to obtain the cookie information corresponding to the first login account when logging in;
and adjusting the initial cross-domain login information according to the first login account and the cookie information, and further determining the corresponding target cross-domain login information during login.
In some embodiments, the data processing module 202 performs, in the process of adjusting the initial cross-domain login information according to the first login account and the cookie information, to further determine the target cross-domain login information corresponding to the login:
determining state information corresponding to the first login account from the initial cross-domain login information according to the first login account;
and adjusting the initial cross-domain login information by utilizing the cookie information according to the state information to obtain the target cross-domain login information.
In some embodiments, the state information includes an abnormal state, an updated state, and a new state, and the data processing module 202 performs, in the process of adjusting the initial cross-domain login information according to the state information to obtain the target cross-domain login information by using the cookie information:
when the state information is the abnormal state, executing abnormal operation corresponding to the abnormal state to obtain latest cookie information, and adjusting the initial cross-domain login information by utilizing the latest cookie information to obtain the target cross-domain login information;
when the state information is the newly added state, the first login account and the cookie information are added into the initial cross-domain login information, so that the target cross-domain login information is obtained;
and when the state information is the updated state, updating information corresponding to the initial cross-domain login information of the first login account according to the cookie information, and further acquiring the target cross-domain login information.
When the state information is the abnormal state, the data processing module 202 executes an abnormal operation corresponding to the abnormal state, and in the process of obtaining the latest cookie information, executes:
transmitting an instruction for re-executing and acquiring the cookie information according to the abnormal state, and acquiring a corresponding latest response header field;
and resolving according to the latest response header field to obtain the latest cookie information.
In some embodiments, the task initiation module 203 performs, in the process of determining, according to the second login account and the target cross-domain login information, the target cookie information corresponding to the second login account:
according to the second login account, information inquiry is carried out from the target cross-domain login information to obtain a target identifier and a target password corresponding to the second login account;
and determining the target cookie information according to the target identifier and the target password.
Optionally, the cross-domain login device 200 is applied to a terminal device.
Referring to fig. 5, fig. 5 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present application.
As shown in fig. 5, the terminal device 300 includes a processor 301 and a memory 302, the processor 301 and the memory 302 being connected by a bus 303, such as an I2C (Inter-integrated Circuit) bus.
In particular, the processor 301 is used to provide computing and control capabilities, supporting the operation of the entire terminal device. The processor 301 may be a central processing unit (Central Processing Unit, CPU), the processor 301 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Specifically, the Memory 302 may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk, a removable hard disk, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 5 is merely a block diagram of a portion of the structure related to the embodiment of the present application, and does not constitute a limitation of the terminal device to which the embodiment of the present application is applied, and that a specific server may include more or less components than those shown in the drawings, or may combine some components, or have a different arrangement of components.
The processor is configured to run a computer program stored in the memory, and implement any one of the cross-domain login methods provided by the embodiments of the present application when the computer program is executed.
In an embodiment, the processor is configured to run a computer program stored in a memory and to implement the following steps when executing the computer program:
acquiring a first login account, and calling a login interface according to the first login account to acquire a response header field;
analyzing the response header field to obtain cookie information corresponding to the first login account when logging in, and determining target cross-domain login information corresponding to the first login account and the cookie information when logging in;
executing a task starting command, obtaining a second login account, and determining target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information;
and executing cross-domain login of the task according to the target cookie information.
In some embodiments, the processor 301 performs, in the process of obtaining the first login account number:
determining the number of login users, and when the number of login users is larger than the preset number, sending a selection instruction so that the user determines a target login user according to the selection instruction;
and receiving the target login user, and determining the first login account according to the target login user.
In some embodiments, in the process of analyzing the response header field to obtain the cookie information corresponding to the first login account when logging in, and determining the target cross-domain login information corresponding to the first login account and the cookie information when logging in, the processor 301 performs:
determining initial cross-domain login information;
analyzing the response header field according to the keywords to obtain the cookie information corresponding to the first login account when logging in;
and adjusting the initial cross-domain login information according to the first login account and the cookie information, and further determining the corresponding target cross-domain login information during login.
In some embodiments, the processor 301 performs, in the process of adjusting the initial cross-domain login information according to the first login account and the cookie information, to further determine the target cross-domain login information corresponding to the login:
determining state information corresponding to the first login account from the initial cross-domain login information according to the first login account;
and adjusting the initial cross-domain login information by utilizing the cookie information according to the state information to obtain the target cross-domain login information.
In some embodiments, the state information includes an abnormal state, an updated state, and a new state, and the processor 301 performs, in adjusting the initial cross-domain login information to obtain the target cross-domain login information according to the state information using the cookie information:
when the state information is the abnormal state, executing abnormal operation corresponding to the abnormal state to obtain latest cookie information, and adjusting the initial cross-domain login information by utilizing the latest cookie information to obtain the target cross-domain login information;
when the state information is the newly added state, the first login account and the cookie information are added into the initial cross-domain login information, so that the target cross-domain login information is obtained;
and when the state information is the updated state, updating information corresponding to the initial cross-domain login information of the first login account according to the cookie information, and further acquiring the target cross-domain login information.
In some embodiments, when the state information is the abnormal state, the processor 301 executes an abnormal operation corresponding to the abnormal state, and in a process of obtaining the latest cookie information, the processor executes:
transmitting an instruction for re-executing and acquiring the cookie information according to the abnormal state, and acquiring a corresponding latest response header field;
and resolving according to the latest response header field to obtain the latest cookie information.
In some embodiments, the processor 301 performs, in the determining, according to the second login account and the target cross-domain login information, the target cookie information corresponding to the second login account:
according to the second login account, information inquiry is carried out from the target cross-domain login information to obtain a target identifier and a target password corresponding to the second login account;
and determining the target cookie information according to the target identifier and the target password.
It should be noted that, for convenience and brevity of description, a specific working process of the terminal device described above may refer to a corresponding process in the foregoing cross-domain login method embodiment, which is not described herein again.
Embodiments of the present application also provide a storage medium for computer readable storage, where the storage medium stores one or more programs executable by one or more processors to implement steps of any of the methods for cross-domain login as provided in the embodiments of the present application.
The storage medium may be an internal storage unit of the terminal device according to the foregoing embodiment, for example, a hard disk or a memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware embodiment, the division between the 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 cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, 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 both 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 known to those skilled 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 be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, 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.
It should be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions may be made therein without departing from the spirit and scope of the application as defined by the appended claims. Therefore, the protection scope of the application is subject to the protection scope of the claims.
Claims (10)
1. A method of cross-domain login, the method comprising:
acquiring a first login account, and calling a login interface according to the first login account to acquire a response header field;
analyzing the response header field to obtain cookie information corresponding to the first login account when logging in, and determining target cross-domain login information corresponding to the first login account and the cookie information when logging in;
executing a task starting command, obtaining a second login account, and determining target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information;
and executing cross-domain login of the task according to the target cookie information.
2. The method according to claim 1, wherein the obtaining a first login account includes:
determining the number of login users, and when the number of login users is larger than the preset number, sending a selection instruction so that the user determines a target login user according to the selection instruction;
and receiving the target login user, and determining the first login account according to the target login user.
3. The method of claim 1, wherein the parsing the response header field to obtain cookie information corresponding to the first login account when the first login account is logged in, and determining target cross-domain login information corresponding to the first login account and the cookie information when the first login account is logged in, includes:
determining initial cross-domain login information;
analyzing the response header field according to the keywords to obtain the cookie information corresponding to the first login account when logging in;
and adjusting the initial cross-domain login information according to the first login account and the cookie information, and further determining the corresponding target cross-domain login information during login.
4. A method as claimed in claim 3, wherein said adjusting the initial cross-domain login information according to the first login account and the cookie information, to thereby determine the target cross-domain login information corresponding to the login, comprises:
determining state information corresponding to the first login account from the initial cross-domain login information according to the first login account;
and adjusting the initial cross-domain login information by utilizing the cookie information according to the state information to obtain the target cross-domain login information.
5. The method as claimed in claim 4, wherein the status information includes an abnormal status, an updated status, and a newly added status, and wherein the adjusting the initial cross-domain login information to obtain the target cross-domain login information according to the status information using the cookie information includes:
when the state information is the abnormal state, executing abnormal operation corresponding to the abnormal state to obtain latest cookie information, and adjusting the initial cross-domain login information by utilizing the latest cookie information to obtain the target cross-domain login information;
when the state information is the newly added state, the first login account and the cookie information are added into the initial cross-domain login information, so that the target cross-domain login information is obtained;
and when the state information is the updated state, updating information corresponding to the initial cross-domain login information of the first login account according to the cookie information, and further acquiring the target cross-domain login information.
6. The method as claimed in claim 5, wherein when the state information is the abnormal state, performing an abnormal operation corresponding to the abnormal state to obtain the latest cookie information, including:
transmitting an instruction for re-executing and acquiring the cookie information according to the abnormal state, and acquiring a corresponding latest response header field;
and resolving according to the latest response header field to obtain the latest cookie information.
7. The method according to claim 1, wherein the determining the target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information includes:
according to the second login account, information inquiry is carried out from the target cross-domain login information to obtain a target identifier and a target password corresponding to the second login account;
and determining the target cookie information according to the target identifier and the target password.
8. An apparatus for cross-domain login, comprising:
the data acquisition module is used for acquiring a first login account and calling a login interface according to the first login account to acquire a response header field;
the data processing module is used for analyzing the response header field to obtain cookie information corresponding to the first login account when the first login account is logged in, and determining target cross-domain login information corresponding to the first login account and the cookie information when the first login account is logged in;
the task starting module is used for executing a task starting command, obtaining a second login account, and determining target cookie information corresponding to the second login account according to the second login account and the target cross-domain login information;
and the cross-domain login module is used for executing cross-domain login of the task according to the target cookie information.
9. A terminal device, characterized in that the terminal device comprises a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program and to implement the method of cross-domain logging according to any one of claims 1 to 7 when the computer program is executed.
10. A computer-readable storage medium, which when executed by one or more processors, causes the one or more processors to perform the steps of the method of cross-domain logging according to any one of claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311069290.0A CN117014427A (en) | 2023-08-22 | 2023-08-22 | Cross-domain login method, device, terminal equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311069290.0A CN117014427A (en) | 2023-08-22 | 2023-08-22 | Cross-domain login method, device, terminal equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117014427A true CN117014427A (en) | 2023-11-07 |
Family
ID=88570953
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311069290.0A Pending CN117014427A (en) | 2023-08-22 | 2023-08-22 | Cross-domain login method, device, terminal equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117014427A (en) |
-
2023
- 2023-08-22 CN CN202311069290.0A patent/CN117014427A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20240064058A1 (en) | Implementation of compliance settings by a mobile device for compliance with a configuration scenario | |
| US9870268B2 (en) | Virtual computing instance migration | |
| US20190138297A1 (en) | Method, apparatus, and system for hot-deploying application | |
| CN110351325B (en) | Data processing method and related equipment | |
| CN111538659B (en) | Interface testing method, system, electronic equipment and storage medium of business scene | |
| CN105740330B (en) | Method and device for displaying data in paging mode | |
| CN110968478A (en) | Log collection method, server and computer storage medium | |
| EP3866031A1 (en) | Webpage loading method, intermediate server, and webpage loading system | |
| CN110881224A (en) | Network long connection method, device, equipment and storage medium | |
| CN104298675A (en) | Method and device for cache management | |
| CN113191889A (en) | Wind control configuration method, configuration system, electronic device and readable storage medium | |
| CN114185804B (en) | Interface testing method and device and terminal equipment | |
| CN110677353B (en) | Data access method and system | |
| CN111800511B (en) | Synchronous login state processing method, system, equipment and readable storage medium | |
| CN112084114B (en) | Method and apparatus for testing interfaces | |
| US9361303B2 (en) | Systems and methods to facilitate a request for oilfield services using a data transfer protocol | |
| US20170286440A1 (en) | Method, business processing server and data processing server for storing and searching transaction history data | |
| CN117014427A (en) | Cross-domain login method, device, terminal equipment and storage medium | |
| CN110896391B (en) | Message processing method and device | |
| CN117743721A (en) | Data processing method and device | |
| CN116149803A (en) | Transaction processing method and device of database, electronic equipment and storage medium | |
| CN116975200A (en) | Method, device, equipment and medium for controlling working state of server | |
| CN116360937A (en) | Task scheduling method, device, equipment and storage medium | |
| CN114363221A (en) | Heartbeat detection method based on micro-service system, storage medium, electronic device and system | |
| CN110716915A (en) | Method and device for operating database, electronic 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 |