Cross-domain login method and device, electronic equipment and storage medium
By generating and writing target login information, the problem of browsers' cross-domain writing cookies is solved, and the login status sharing of multiple business domain names is realized, which improves user operation fluency and coherence, and simplifies the development process.
Patent Information
- Application Number
- CN202510297112.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, browsers have restrictions on the number of cross-domain writing cookies and redirects, and cannot apply to the situation where the number of business domain names is large, resulting in reduced user operation fluency and coherence, and the login status sharing of multiple business domain names cannot be realized, and there are two jumps, affecting the user's browsing experience.
By generating target login information, obtaining at least one business domain name and sending it to the terminal, automatically triggering cross-domain requests, detecting the validity of the login information, and writing it to the target business domain name when valid and no corresponding login information is available, realizing login status sharing under the unified login domain name.
It simplifies the development process, improves development and operation and maintenance efficiency, realizes the login status sharing of multiple business domain names, improves the fluency and coherence of user operations, and improves the user browsing experience.
Smart Images

Figure CN120342658A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of domain name login, and particularly to a cross-domain login method, device, electronic device, and storage medium. Background Art
[0002] With the continuous development of enterprise business, each business line has a corresponding business domain name. How to achieve the sharing of login status under different business domain names has also become the focus of improving the user browsing experience.
[0003] In related technologies, often when a user logs in to a certain business domain name, a redirection method is used to write Cookies (data used to identify the user and stored on the user's local terminal) one by one to other business domain names. However, the browser has restrictions on cross-domain writing of Cookies and the number of redirections, and it is not applicable to the case of a large number of business domain names, resulting in a reduction in the fluency and coherence of user operations. It is also often to unify the login domain names of each business line. When a user accesses a certain business domain name, they first jump to the login domain name. When the login domain name detects that the user has logged in, based on the generated Token (token) containing the user login information, they jump back to this business domain name to complete the login. In this process, the sharing of login status of multiple business domain names cannot be achieved, and there are two jumps. If the user's network condition is poor, a blank page will appear, thus affecting the user browsing experience. Summary of the Invention
[0004] The present disclosure provides a cross-domain login method, device, electronic device, and storage medium to at least solve the problems in related technologies that the browser has restrictions on cross-domain writing of Cookies and the number of redirections, is not applicable to the case of a large number of business domain names, resulting in a reduction in the fluency and coherence of user operations, unable to achieve the sharing of login status of multiple business domain names, and there are two jumps, thus affecting the user browsing experience, etc. The technical solutions of the present disclosure are as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a cross-domain login method is provided, including:
[0006] In response to a login request for a target login domain name triggered during the process of a target account accessing resources on a first business page corresponding to a first business domain name, generating target login information; the target login information is the login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one business domain name; the first business domain name is any one of the at least one business domain names;
[0007] Obtaining the at least one business domain name, and sending the at least one business domain name to a terminal corresponding to the target account, so that the terminal automatically triggers a cross-domain request for each business domain name in the at least one business domain name;
[0008] In response to a target cross - domain request sent by the terminal based on a target service domain name, detect whether the target login information is valid, where the target service domain name is the service domain name among the at least one service domain name that currently triggers the corresponding cross - domain request;
[0009] In the case where the target login information is valid and there is no corresponding login information for the target service domain name, write the target login information as the login information corresponding to the target service domain name under the target service domain name.
[0010] In an alternative embodiment, in the case where writing the target login information as the login information corresponding to the first service domain name fails and the terminal fails to access the first service page, the method further includes:
[0011] Receive a login detection request automatically triggered by the terminal when the terminal fails to access the first service page;
[0012] Detect whether the target login information is valid;
[0013] In the case where the target login information is valid, write the target login information as the login information corresponding to the first service domain name under the first service domain name
[0014] In an alternative embodiment, the method further includes:
[0015] Send the first service domain name and the login information corresponding to the first service domain name to the terminal, so that the terminal can jump to the first service page based on the first service domain name and the target login information.
[0016] In an alternative embodiment, before generating the target login information in response to a login request for a target login domain name triggered during the process of the target account accessing resources on the first service page corresponding to the first service domain name, the method further includes:
[0017] In the case where there is no corresponding login information for the first service domain name, in response to a first access request for the first service domain name triggered during the process of the target account accessing resources on the first service page corresponding to the first service domain name, obtain the target login domain name;
[0018] Send the target login domain name to the terminal, so that the terminal can jump to the target login page based on the target login domain name;
[0019] Generating the target login information for the login request for the target login domain name triggered during the process of the target account accessing resources on the first service page corresponding to the first service domain name includes:
[0020] Generating the target login information in response to a login request for the target login domain name triggered on the target login page during the process of the target account accessing resources on the first service page corresponding to the first service domain name.
[0021] In an optional embodiment, the method further includes:
[0022] In response to a second access request of the target account for a second service domain name, where the second service domain name is any one of the at least one service domain name;
[0023] When writing the target login information as the login information corresponding to the second service domain name to the second service domain name fails, detecting whether the target login information is valid;
[0024] When the target login information is valid and writing the target login information as the login information corresponding to the second service domain name to the second service domain name is successful, sending the second service domain name and the login information corresponding to the second service domain name to the terminal, so that the terminal jumps to the second service page corresponding to the second service domain name based on the second service domain name and the target login information.
[0025] In an optional embodiment, the method further includes:
[0026] When the target login information is invalid, sending the target login domain name to the terminal, so that the terminal jumps to the target login page based on the target login domain name and triggers a login request for the target login domain name on the target login page.
[0027] According to a second aspect of the embodiments of the present disclosure, a cross-domain login method is provided, including:
[0028] When detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, sending a login request for the target login domain name to the server, so that the server generates target login information; the target login information is the login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one service domain name; the first service domain name is any one of the at least one service domain name;
[0029] Upon receiving the at least one service domain name sent by the server, automatically trigger a cross-domain request for each service domain name in the at least one service domain name;
[0030] Based on the target service domain name, send a target cross-domain request to the server, so that the server detects whether the target login information is valid, and when the target login information is valid and there is no corresponding login information for the target service domain name, write the target login information as the login information corresponding to the target service domain name under the target service domain name; the target service domain name is the service domain name that currently triggers the corresponding cross-domain request in the at least one service domain name.
[0031] In an optional embodiment, when the server fails to write the target login information as the login information corresponding to the first service domain name under the first service domain name and fails to access the first service page, the method further includes:
[0032] Send a login detection request automatically triggered when accessing the first service page fails to the server, so that the server detects whether the target login information is valid, and when the target login information is valid, write the target login information as the login information corresponding to the first service domain name under the first service domain name.
[0033] In an optional embodiment, the method further includes:
[0034] Upon receiving the first service domain name and the login information corresponding to the first service domain name sent by the server, based on the first service domain name and the target login information, jump to the first service page.
[0035] In an optional embodiment, before sending a login request for the target login domain name to the server to enable the server to generate the target login information during the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, the method further includes:
[0036] During the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, send a first access request for the first service domain name to the server, so that the server obtains the target login domain name when there is no corresponding login information for the first service domain name;
[0037] Upon receiving the target login domain name sent by the server, based on the target login domain name, jump to the target login page;
[0038] During the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, sending a login request for the target login domain name to the server, so that the server generates the target login information, including:
[0039] During the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, displaying the target login page;
[0040] In the case of detecting a login request for the target login domain name triggered by the target login page, sending the login request to the server, so that the server generates the target login information.
[0041] In an alternative embodiment, the method further includes:
[0042] Sending a second access request triggered by the target account for the second service domain name to the server, so that the server detects whether the target login information is valid when writing the target login information as the login information corresponding to the second service domain name fails; the second service domain name is any one of the at least one service domain name;
[0043] Receiving the second service domain name and the login information corresponding to the second service domain name sent by the server when the target login information is valid and writing the target login information as the login information corresponding to the second service domain name is successful, and based on the second service domain name and the target login information, jumping to the second service page corresponding to the second service domain name.
[0044] In an alternative embodiment, the method further includes:
[0045] Receiving the target login domain name sent by the server when the target login information is invalid;
[0046] Based on the target login domain name, jumping to the target login page;
[0047] In the case of detecting a login request for the target login domain name triggered by the target account for the target login page, sending the login request to the server, so that the server generates the target login information.
[0048] According to a third aspect of the embodiments of the present disclosure, a cross-domain login device is provided, including:
[0049] A target login information generation module, which is used to generate target login information in response to a login request for a target login domain name triggered during the process of a target account accessing resources on a first service page corresponding to a first service domain name; the target login information is the login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one service domain name; the first service domain name is any one of the at least one service domain names.
[0050] A service domain name sending module, which is used to obtain the at least one service domain name and send the at least one service domain name to the terminal corresponding to the target account, so that the terminal automatically triggers a cross-domain request for each service domain name in the at least one service domain name.
[0051] A first detection module, which is used to detect whether the target login information is valid in response to a target cross-domain request sent by the terminal based on a target service domain name, and the target service domain name is the service domain name that currently triggers the corresponding cross-domain request in the at least one service domain name.
[0052] A target login information writing module, which is used to write the target login information as the login information corresponding to the target service domain name under the target service domain name when the target login information is valid and there is no corresponding login information for the target service domain name.
[0053] In an optional embodiment, before the target login information generation module, the device further includes:
[0054] A target login domain name obtaining module, which is used to obtain the target login domain name in response to a first access request for the first service domain name triggered during the process of the target account accessing resources on a first service page corresponding to the first service domain name when there is no corresponding login information for the first service domain name.
[0055] A first target login domain name sending module, which is used to send the target login domain name to the terminal so that the terminal jumps to a target login page based on the target login domain name.
[0056] The target login information generation module includes:
[0057] A target login information generation unit, which is used to generate the target login information in response to a login request for a target login domain name triggered on the target login page during the process of a target account accessing resources on a first service page corresponding to a first service domain name.
[0058] In an optional embodiment, when writing the target login information as the login information corresponding to the first service domain name fails, and the terminal fails to access the first service page, the apparatus further includes:
[0059] A login detection request receiving module, configured to receive a login detection request automatically triggered by the terminal when the terminal fails to access the first service page;
[0060] A second detection module, configured to detect whether the target login information is valid;
[0061] A first login information writing module, configured to write the target login information as the login information corresponding to the first service domain name under the first service domain name when the target login information is valid.
[0062] In an optional embodiment, the apparatus further includes:
[0063] A first sending module, configured to send the first service domain name and the login information corresponding to the first service domain name to the terminal, so that the terminal jumps to the first service page based on the first service domain name and the target login information.
[0064] In an optional embodiment, the apparatus further includes:
[0065] A third detection module, configured to respond to a second access request of the target account for a second service domain name, where the second service domain name is any one of the at least one service domain name;
[0066] When writing the target login information as the login information corresponding to the second service domain name fails, detect whether the target login information is valid;
[0067] A second sending module, configured to send the second service domain name and the login information corresponding to the second service domain name to the terminal when the target login information is valid and writing the target login information as the login information corresponding to the second service domain name succeeds, so that the terminal jumps to the second service page corresponding to the second service domain name based on the second service domain name and the target login information.
[0068] In an optional embodiment, the apparatus further includes:
[0069] A second target login domain name sending module, configured to send the target login domain name to the terminal when the target login information is invalid, so that the terminal jumps to a target login page based on the target login domain name, and triggers a login request for the target login domain name on the target login page.
[0070] According to a fourth aspect of the embodiments of the present disclosure, there is provided a cross-domain login device, including:
[0071] A first login request sending module, configured to send a login request for a target login domain name to a server when detecting that a target account is accessing resources on a first service page corresponding to a first service domain name, so that the server generates target login information; the target login information is login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one service domain name; the first service domain name is any one of the at least one service domain names;
[0072] A cross-domain request triggering module, configured to automatically trigger a cross-domain request for each service domain name in the at least one service domain name when receiving the at least one service domain name sent by the server;
[0073] A target cross-domain request sending module, configured to send a target cross-domain request to the server based on a target service domain name, so that the server detects whether the target login information is valid, and when the target login information is valid and there is no corresponding login information for the target service domain name, write the target login information as the login information corresponding to the target service domain name under the target service domain name; the target service domain name is the service domain name for which a corresponding cross-domain request is currently triggered in the at least one service domain name.
[0074] In an optional embodiment, before the first login request sending module, the device further includes:
[0075] A first access request sending module, configured to send a first access request for the first service domain name to the server when detecting that the target account is accessing resources on a first service page corresponding to the first service domain name, so that the server obtains the target login domain name when there is no corresponding login information for the first service domain name;
[0076] A first target jump module, configured to jump to a target login page based on the target login domain name when receiving the target login domain name sent by the server;
[0077] The first login request sending module includes:
[0078] A target login page display module, configured to display the target login page during the process of detecting that a target account accesses resources in a first service page corresponding to a first service domain name;
[0079] A login request sending unit, configured to send the login request to a server when detecting a login request for a target login domain name triggered by the target login page, so that the server generates target login information.
[0080] In an optional embodiment, when the server fails to write the target login information as the login information corresponding to the first service domain name into the first service domain name, and accessing the first service page fails, the apparatus further includes:
[0081] A login detection request triggering module, configured to send a login detection request automatically triggered when accessing the first service page fails to the server, so that the server detects whether the target login information is valid, and when the target login information is valid, write the target login information as the login information corresponding to the first service domain name under the first service domain name.
[0082] In an optional embodiment, the apparatus further includes:
[0083] A first service page jump module, configured to jump the first service page based on the first service domain name and the target login information when receiving the first service domain name and the login information corresponding to the first service domain name sent by the server.
[0084] In an optional embodiment, the apparatus further includes:
[0085] A second access request sending module, configured to send a second access request triggered by the target account for a second service domain name to the server, so that the server detects whether the target login information is valid when failing to write the target login information as the login information corresponding to the second service domain name into the second service domain name; the second service domain name is any one of the at least one service domain name;
[0086] A second service page jump module, configured to receive the second service domain name and the login information corresponding to the second service domain name sent by the server when the target login information is valid and the server successfully writes the target login information as the login information corresponding to the second service domain name, and jump the second service page corresponding to the second service domain name based on the second service domain name and the target login information.
[0087] In an optional embodiment, the apparatus further includes:
[0088] A third target login domain name sending module, configured to receive the target login domain name sent by the server when the target login information is invalid.
[0089] A second target jump module, configured to jump to a target login page based on the target login domain name.
[0090] A second login request sending module, configured to send the login request to the server when it is detected that the target account triggers a login request for the target login domain name on the target login page, so that the server generates the target login information.
[0091] According to a fifth aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein, the processor is configured to execute the instructions to implement the method according to any one of the above first aspects.
[0092] According to a sixth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the method according to any one of the first aspects of the embodiments of the present disclosure.
[0093] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:
[0094] In response to a login request for a target login domain triggered during the process of a target account accessing resources on a first service page corresponding to a first service domain name, target login information is generated, and the target login information is the login status information of the target account under the target login domain name. The target login domain name is a combined login domain name corresponding to at least one service domain name, and the first service domain name is any one of the at least one service domain names. Logins can be performed through a unified target login domain name, eliminating the need to develop separate login functions for each service domain name, simplifying the development process, improving development and operation and maintenance efficiency. After generating the target login information, at least one service domain name is obtained and sent to the terminal corresponding to the target account, so that the terminal automatically triggers cross-domain requests for each service domain name in the at least one service domain name. In response to the target cross-domain requests sent by the terminal based on the target service domain name, it is detected whether the target login information is valid. The target service domain name is the service domain name currently triggering the corresponding cross-domain request among the at least one service domain names. In the case where the target login information is valid and there is no corresponding login information for the target service domain name, the target login information is written as the login information corresponding to the target service domain name under the target service domain name. By unifying the login domain names of each business line, the sharing of login statuses for multiple service domain names can be achieved, enhancing the fluency and coherence of user operations, and thus enhancing the user browsing experience.
[0095] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0097] Figure 1 is a schematic diagram of an application environment shown according to an exemplary embodiment;
[0098] Figure 2 is a flowchart of a cross-domain login method shown according to an exemplary embodiment;
[0099] Figure 3 is a flowchart of a cross-domain login method shown according to an exemplary embodiment;
[0100] Figure 4 is a block diagram of a cross-domain login device shown according to an exemplary embodiment;
[0101] Figure 5 is a block diagram of a cross-domain login device shown according to an exemplary embodiment;
[0102] Figure 6A block diagram of an electronic device for cross - domain login according to an exemplary embodiment;
[0103] Figure 7 A block diagram of an electronic device for cross - domain login according to an exemplary embodiment. Detailed implementation manners
[0104] To enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0105] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above - mentioned drawings are used to distinguish similar different contents, and do not necessarily describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0106] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in the present disclosure are all information and data authorized by the user or fully authorized by all parties.
[0107] Please refer to Figure 1 , Figure 1 A schematic diagram of an application environment according to an exemplary embodiment, as Figure 1 shown, the application environment may include a terminal 100 and a server 200.
[0108] In an alternative embodiment, the terminal 100 can be used to provide a login service for a target login domain. Specifically, the terminal 100 may include, but is not limited to, types of electronic devices such as smart phones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc., or may also be software running on the above - mentioned electronic devices, such as application programs. Optionally, the operating systems running on the electronic devices may include, but are not limited to, Android systems, IOS systems, Linux, Windows, etc.
[0109] In an optional embodiment, the server 200 may provide background services for the terminal 100, generate target login information, and write the target login information under at least one business domain name. Specifically, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0110] In addition, it should be noted that Figure 1 The application environment shown is only one provided by the present disclosure. In actual applications, other application environments may also be included. For example, cross-domain login can also be implemented on the terminal.
[0111] In the embodiments of this specification, the above-mentioned terminal 100 and server 200 may be directly or indirectly connected through wired or wireless communication methods, and the present disclosure does not limit this.
[0112] Figure 2 is a flowchart of a cross-domain login method shown according to an exemplary embodiment. As Figure 2 shown, this cross-domain login method is used in a server and includes the following steps.
[0113] In step S201, in response to a login request for a target login domain name triggered during the process of the target account accessing resources on the first service page corresponding to the first service domain name, target login information is generated.
[0114] In a specific embodiment, the target account may be the user account currently requesting to log in. The first service may correspond to different services according to actual application requirements. The first service domain name may be the domain name corresponding to the first service. The first service page may be a page for providing the first service. The target login domain may be a combined login domain name corresponding to at least one service domain name. At least one service domain name may correspond to at least one service domain. The first service domain name may be any one of the at least one service domain names.
[0115] In a specific embodiment, taking the first service as a financial service as an example, correspondingly, the first service domain name can be the domain name corresponding to the financial service, the first service page can be a page for providing financial services, and the first service page can include resources such as account resources (account balance, account transaction details, etc.), product resources (introduction of financial products, loan product information, etc.), and service resources (transfer and remittance entry, payment for bills, etc.). Optionally, in response to a login request for the target login domain name triggered during the process of the target account accessing the service resources on the page providing financial services, target login information is generated.
[0116] In a specific embodiment, the target login information can be the login status information of the target account under the target login domain name, and the target login information can be used to determine whether the target account is in a logged-in state under the target login domain. Exemplarily, the target login information can be the login status information in the Cookie of the target account under the target login domain name.
[0117] In an optional embodiment, before generating the target login information in response to the login request for the target login domain name triggered during the process of the target account accessing the resources on the first service page corresponding to the first service domain name, the method may further include:
[0118] In the case where there is no corresponding login information for the first service domain name, in response to the first access request for the first service domain name triggered during the process of the target account accessing the resources on the first service page corresponding to the first service domain name, obtain the target login domain name;
[0119] In a specific embodiment, the login information corresponding to the first service domain name can be the login status information in the Cookie under the first service domain name. Correspondingly, it can be determined whether there is corresponding login information for the first service domain name by checking whether there is a corresponding Cookie under the first service domain name.
[0120] In a specific embodiment, the first access request can be an access request for the first service domain name triggered during the process of the target account accessing the resources on the first service page corresponding to the first service domain name.
[0121] Send the target login domain name to the terminal so that the terminal can jump to the target login page based on the target login domain name;
[0122] In a specific embodiment, the target login page can be a combined login page corresponding to at least one service domain name. Correspondingly, the target login page can be the page corresponding to the target login domain name.
[0123] The generation of the target login information for the login request for the target login domain name triggered during the process of the target account accessing resources on the first service page corresponding to the first service domain name may include:
[0124] Generating the target login information in response to a login request for the target login domain name triggered on the target login page during the process of the target account accessing resources on the first service page corresponding to the first service domain name.
[0125] In a specific embodiment, taking the first service as an e-commerce service as an example, correspondingly, the first service domain name may be the domain name corresponding to the e-commerce service, the first service page may be a page for providing e-commerce services, and the first service page may include resources such as commodity resources (commodity pictures, commodity detail introductions, etc.), user resources (user order records, user favorite information, etc.), and marketing resources (claim links, coupons, etc.). Exemplarily, generating the target login information in response to a login request for the target login domain name triggered on the target login page during the process of the target account accessing service resources on the page corresponding to the e-commerce service.
[0126] In the above embodiment, by presetting the combined login domain names corresponding to at least one service domain name, in the case where there is no corresponding login information for the first service domain name, in response to the first access request for the first service domain name triggered during the process of the target account accessing resources on the first service page corresponding to the first service domain name, obtaining the target login domain name, and sending the target login domain name to the terminal, so that the terminal jumps to the target login page based on the target login domain name, and generating the target login information in response to the login request for the target login domain name triggered on the target login page, it can be realized that the user only needs to perform a single login operation on the target login page to access resources under multiple service domain names, and only needs to develop a unified login module for the target login domain name, without the need to develop a login function for each service domain name separately, which simplifies the development process and improves the development and operation and maintenance efficiency.
[0127] In step S203, obtaining at least one service domain name and sending the at least one service domain name to the terminal corresponding to the target account, so that the terminal automatically triggers a cross-domain request for each service domain name in the at least one service domain name;
[0128] In a specific embodiment, the cross-domain request may be an access request for realizing cross-domain data interaction initiated by the terminal for resources on a page corresponding to another service domain name under one service domain name. Exemplarily, the cross-domain request may be initiated through JSONP (JSON with Padding, a technology for making cross-domain data requests).
[0129] In a specific embodiment, by way of example, the target login domain name may be https: / / login.example.com, and the target service domain name may be https: / / app.example.com. The cross-domain request sent by the terminal from the target login page corresponding to the target login domain name based on the target service domain name via JSONP is a cross-domain request because the target login domain name and the target service domain name are different domain names (different origins). The request sent by the terminal from the target login page corresponding to https: / / login.example.com based on https: / / app.example.com via JSONP belongs to a cross-domain request.
[0130] In a specific embodiment, the cross-domain request for each service domain name among at least one service domain name may be an access request for implementing cross-domain data interaction initiated by the terminal under the login domain name for the resources in each service page corresponding to each service domain name among at least one service domain name.
[0131] In step S205, in response to the target cross-domain request sent by the terminal based on the target service domain name, detect whether the target login information is valid;
[0132] In a specific embodiment, the target cross-domain request may be a cross-domain request sent by the terminal based on the target service domain name, and the target service domain name may be the service domain name corresponding to the currently triggered cross-domain request among at least one service domain name.
[0133] In step S207, when the target login information is valid and there is no corresponding login information for the target service domain name, write the target login information as the login information corresponding to the target service domain name under the target service domain name.
[0134] In a specific embodiment, the login information corresponding to the target service domain name may be the login status information in the Cookie under the target service domain name. Correspondingly, it is possible to determine whether there is corresponding login information for the target service domain name by checking whether there is a corresponding Cookie under the target service domain name.
[0135] In a specific embodiment, taking the target login information as the login status information in the Cookie under the target login domain name for the target account as an example, when the target login information is valid and there is no corresponding login information for the target service domain name, the login status information in the Cookie under the target login domain name may be written as the login information corresponding to the target service domain name under the target service domain name, and the process is repeated until the target login information is written as the login information corresponding to each of at least one service domain name under at least one service domain name.
[0136] In an optional embodiment, when writing the target login information as the login information corresponding to the first service domain name fails, if the terminal fails to access the first service page, the method may further include:
[0137] Receiving a login detection request automatically triggered by the terminal when it fails to access the first service page;
[0138] In a specific embodiment, the login detection request may be a request for detecting whether the target login information is valid. Specifically, the login detection request may be a request sent by the terminal on the target login page corresponding to the target login domain.
[0139] Detecting whether the target login information is valid;
[0140] In a specific embodiment, taking the session Cookie as an example, when the target login information is the login status information in the Cookie of the target account under the target login domain name, after the target account successfully logs in to the target login domain, a session can be created, and the session validity period or the validity period of the session Cookie can be set in advance. By detecting whether the session is within the session validity period or whether the target login information is within the validity period of the session Cookie, it is detected whether the target login information is valid.
[0141] When the target login information is valid, writing the target login information as the login information corresponding to the first service domain name under the first service domain name.
[0142] In a specific embodiment, taking the target login information as the login status information in the Cookie of the target account under the target login domain name as an example, when the target login information is valid and there is no corresponding login information for the target service domain name, the login status information in the Cookie under the target login domain name can be written as the login information corresponding to the first service domain name under the first service domain name.
[0143] In the above embodiment, after writing the target login information as the login information corresponding to the first service domain name fails, a login detection request is automatically triggered. When the target login information is valid, the target login information is rewritten as the login information corresponding to the first service domain name under the first service domain name, which improves the efficiency of service processing, can handle the situation where the user needs to log in again due to the failure of cross-domain operation writing, improves the reliability and availability of the system, and thus enhances the user experience.
[0144] In an optional embodiment, the method may further include:
[0145] Send the first service domain name and the login information corresponding to the first service domain name to the terminal, so that the terminal can jump to the first service page based on the first service domain name and the target login information.
[0146] In a specific embodiment, when the target login information is successfully written as the login information corresponding to the first service domain name, for example, the first service domain name can be https: / / app1.example.com, and the login information corresponding to the first service domain name can be the login status information in the Cookie under the first service domain name. The target login domain name can be https: / / login.example.com, and the login status information in the Cookie under the first service domain name can be the login status information in the Cookie under https: / / login.example.com. Send https: / / app1.example.com and the login status information in the Cookie under https: / app1.example.com to the terminal, so that the terminal can jump to the page corresponding to https: / / app1.example.com based on https: / / app1.example.com and the login status information in the Cookie under https: / / login.example.com.
[0147] In the above embodiment, when the target login information is successfully written as the login information corresponding to the first service domain name and sent to the terminal together with the first service domain name and the login information corresponding to the first service domain name, so that the terminal can jump to the first service page based on the first service domain name and the target login information, fast page jumps and stable access can be achieved, improving the overall business operation efficiency.
[0148] In an alternative embodiment, the above method may further include:
[0149] Respond to the second access request of the target account for the second service domain name;
[0150] In a specific embodiment, the second service domain name can be any service domain name among at least one service domain name;
[0151] When the target login information fails to be written as the login information corresponding to the second service domain name, detect whether the target login information is valid;
[0152] In a specific embodiment, the second service can correspond to different services according to actual application requirements. The second service domain name can be the domain name used to access the second service, and the second service page can be the page used to provide the second service.
[0153] In a specific embodiment, when writing the target login information as the login information corresponding to the second service domain name fails, specifically, when the terminal fails to access the second service page, a login detection request automatically triggered by the terminal when it fails to access the second service page is received, and it is detected whether the target login information is valid.
[0154] When the target login information is valid and writing the target login information as the login information corresponding to the second service domain name into the second service domain name is successful, the second service domain name and the login information corresponding to the second service domain name are sent to the terminal, so that the terminal can jump to the second service page corresponding to the second service domain name based on the second service domain name and the target login information.
[0155] In a specific embodiment, taking the login status information in the Cookie of the target account under the target login domain name as the target login information as an example, specifically, when the login status information of the target account in the Cookie under the target login domain name is valid and writing it into the second service domain name is successful, the second service domain name and the login information corresponding to the second service domain name are sent to the terminal, so that the terminal can jump to the second service page corresponding to the second service domain name based on the second service domain name and the login status information of the target account in the Cookie under the target login domain name.
[0156] In the above embodiment, when writing the target login information as the login information corresponding to the second service domain name fails, it is detected whether the target login information is valid. When the target login information is valid and writing the target login information as the login information corresponding to the second service domain name into the second service domain name is successful, the second service domain name and the login information corresponding to the second service domain name are sent to the terminal, so that the terminal can jump to the second service page corresponding to the second service domain name based on the second service domain name and the target login information. It can realize jumping and accessing the page corresponding to any service domain name in at least one service domain name based on the target login information, uniformly manage and process the login information of multiple service domain names, and ensure the consistency and integrity of login data.
[0157] In an alternative embodiment, the above method may further include:
[0158] When the target login information is invalid, the target login domain name is sent to the terminal, so that the terminal can jump to the target login page based on the target login domain name and trigger a login request for the target login domain name on the target login page.
[0159] In a specific embodiment, when the target login information is the login status information in the Cookie under the target login domain name for the target account, for example, the Cookie under the target login domain name can be a session Cookie. If the session ends, the Cookie becomes invalid with the end of the session. Correspondingly, the relevant Cookie cannot be read under the target login domain name.
[0160] In a specific embodiment, taking the target login information as the login status information in the session Cookie under the target login domain name for the target account as an example, specifically, when the relevant Cookie cannot be read under the target login domain name, the target login domain name is sent to the terminal so that the terminal can jump to the target login page based on the target login domain name and trigger a login request for the target login domain name on the target login page.
[0161] In the above embodiment, by sending the target login domain name to the terminal when the target login information is invalid, so that the terminal can jump to the target login page based on the target login domain name and trigger a login request for the target login domain name, invalid login information can be identified in a timely manner and the user can be guided to log in again, ensuring the safe and stable operation of the business system.
[0162] Figure 3 It is a flowchart of a cross-domain login method shown according to an exemplary embodiment. As Figure 3 shown, this cross-domain login method is used in a terminal and includes the following steps.
[0163] In step S301, during the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, a login request for the target login domain name is sent to the server so that the server generates the target login information;
[0164] In a specific embodiment, the target account can be accounts corresponding to different users. The first service can correspond to different services according to actual application requirements. The first service domain name can be the domain name corresponding to the first service. The first service page can be a page for providing the first service. The target login domain can be a combined login domain name corresponding to at least one service domain name. At least one service domain name can correspond to at least one service domain. The first service domain name can be any one of the at least one service domain names.
[0165] In a specific embodiment, taking the first service as a social media service as an example, correspondingly, the first service domain name can be the domain name corresponding to the social media service, the first service page can be a page for providing the social media service, and the first service page can include resources such as content resources (content posted by users, forwarded content, etc.), interaction resources (likes, comments, forwards, etc.), and topic resources (topic content, topic comments, etc.). Optionally, during the process of detecting that the target account is accessing the content resources in the page corresponding to the social media service, a login request for the target login domain name can be sent to the server to enable the server to generate target login information.
[0166] In a specific embodiment, the target login information can be the login status information of the target account under the target login domain name, and the target login information can be used to determine whether the target account is in a logged-in state under the target login domain. Exemplarily, the target login information can be the login status information in the Cookie of the target account under the target login domain name.
[0167] In an optional embodiment, before sending a login request for the target login domain name to the server to enable the server to generate target login information during the process of detecting that the target account is accessing the resources in the first service page corresponding to the first service domain name, the above method can further include:
[0168] During the process of detecting that the target account is accessing the resources in the first service page corresponding to the first service domain name, a first access request for the first service domain name is sent to the server to enable the server to obtain the target login domain name when there is no corresponding login information for the first service domain name;
[0169] In a specific embodiment, the first access request can be an access request for the first service domain name triggered during the process of the target account accessing the resources in the first service page corresponding to the first service domain name.
[0170] Upon receiving the target login domain name sent by the server, based on the target login domain name, jump to the target login page;
[0171] In a specific embodiment, the target login page can be a combined login page corresponding to at least one service domain name. Correspondingly, the target login page can be the page corresponding to the target login domain name.
[0172] Sending a login request for the target login domain name to the server to enable the server to generate target login information during the process of detecting that the target account is accessing the resources in the first service page corresponding to the first service domain name can include:
[0173] While detecting that a target account is accessing resources on a first service page corresponding to a first service domain name, display a target login page;
[0174] When detecting a login request for a target login domain name triggered by the target login page, send a login request to the server so that the server generates target login information.
[0175] In a specific embodiment, taking the first service as a content management service as an example, correspondingly, the first service domain name can be the domain name corresponding to the content management service, the first service page can be a page providing the content management service, and the first service page can include resources such as Q&A resources (question descriptions, answer contents, etc.), creator resources (creator homepage information, creator published contents, etc.), community resources (comment area contents, article reading volumes, etc.). Exemplarily, while detecting that a target account is accessing Q&A resources on a page corresponding to the content management service, display a target login page; when detecting a login request for a target login domain name triggered by the target login page, send a login request to the server so that the server generates target login information.
[0176] In the above embodiment, by presetting a combined login domain name corresponding to at least one service domain name, in the case where there is no corresponding login information for the first service domain name, while detecting that a target account is accessing resources on a first service page corresponding to the first service domain name, jump to the target login page; when detecting a login request for a target login domain name triggered by the target login page, send a login request to the server so that the server generates target login information, which can enable the user to access the service pages under each service domain name smoothly without having to remember different login information under multiple service domain names, only needing to perform a single login operation on the target login page, greatly reducing the user's operation cost and improving the convenience of use.
[0177] In step S303, when receiving at least one service domain name sent by the server, automatically trigger a cross - domain request for each service domain name in the at least one service domain name;
[0178] In a specific embodiment, a cross - domain request can be an access request for implementing cross - domain data interaction initiated for resources on a page corresponding to another service domain name under one service domain name. Exemplarily, a cross - domain request can be initiated through JSONP (JSON with Padding, a technology for making cross - domain data requests).
[0179] In a specific embodiment, when receiving at least one business domain name sent by the server corresponding to the target login domain, a target cross-domain request is sent from the target login page corresponding to the target login domain name to the target business page corresponding to the target business domain name. Exemplarily, the target login domain name can be https: / / login.example.com, and the target business domain name can be https: / / app.example.com. Since the domain names of the target login domain name and the target business domain name are different, sending a JSONP request from the page corresponding to https: / / login.example.com to the page corresponding to https: / / app.example.com belongs to a cross-domain request.
[0180] In a specific embodiment, the cross-domain request for each business domain name among at least one business domain name can be an access request for realizing cross-domain data interaction initiated for resources in each business page corresponding to each business domain name among at least one business domain name under the login domain name.
[0181] In step S305, based on the target business domain name, a target cross-domain request is sent to the server, so that the server detects whether the target login information is valid, and when the target login information is valid and there is no corresponding login information for the target business domain name, the target login information is written as the login information corresponding to the target business domain name under the target business domain name.
[0182] In a specific embodiment, the target cross-domain request can be a cross-domain request sent to the server based on the target business domain name, and the target business domain name can be the business domain name that currently triggers the corresponding cross-domain request among at least one business domain name.
[0183] In an alternative embodiment, when the server fails to write the target login information as the login information corresponding to the first business domain name under the first business domain name and the access to the first business page fails, the method may further include:
[0184] Sending a login detection request automatically triggered when the access to the first business page fails to the server, so that the server detects whether the target login information is valid, and when the target login information is valid, writing the target login information as the login information corresponding to the first business domain name under the first business domain name.
[0185] In a specific embodiment, the login detection request can be a request for detecting whether the target login information is valid. Specifically, the login detection request can be a request sent to the detection interface under the target login domain from the target login page corresponding to the target login domain.
[0186] In the above embodiments, after the server fails to write the target login information as the login information corresponding to the first service domain name to the first service domain name, a login detection request is automatically triggered, so that when the server detects that the target login information is valid, the target login information is written as the login information corresponding to the first service domain name under the first service domain name again, which can ensure that users can normally view the first service page, avoid problems such as jumping to other pages or frequent logins due to write failures, and improve the fluency and coherence of users when using the system.
[0187] In an alternative embodiment, the above method may further include:
[0188] Upon receiving the first service domain name and the login information corresponding to the first service domain name sent by the server, based on the first service domain name and the target login information, the first service page is redirected.
[0189] In a specific embodiment, when the target login information is successfully written as the login information corresponding to the first service domain name to the first service domain name, for example, the first service domain name may be https: / / app2.example.com, the login information corresponding to the first service domain name may be the login status information in the Cookie under the first service domain name, the target login domain name may be https: / / login.example.com, and the login status information in the Cookie under the first service domain name may be the login status information in the Cookie under https: / / login.example.com. Upon receiving the https: / / app2.example.com and the login information corresponding to https: / / app2.example.com sent by the server, based on https: / / app2.example.com and the login status information in the Cookie under https: / / login.example.com, the page corresponding to https: / / app2.example.com is redirected.
[0190] In the above embodiments, when the target login information is successfully written as the login information corresponding to the first service domain name to the first service domain name, upon receiving the first service domain name and the login information corresponding to the first service domain name sent by the server, based on the first service domain name and the target login information, the first service page is redirected, which can enable users to directly jump to the first service page after completing the login, without manually entering the website address or searching for the page entry again, improving the coherence and fluency of the operation.
[0191] In an alternative embodiment, the above method may further include:
[0192] Send a second access request triggered by a target account for a second service domain name to the server, so that the server can detect whether the target login information is valid when it fails to write the target login information as the login information corresponding to the second service domain name;
[0193] In a specific embodiment, the second service can correspond to different services according to actual application requirements. The second service domain name can be a domain name used to access the second service, and the second service page can be a page used to provide the second service.
[0194] Receive the second service domain name and the login information corresponding to the second service domain name sent by the server when the target login information is valid and it is successful to write the target login information as the login information corresponding to the second service domain name, and based on the second service domain name and the target login information, jump to the second service page corresponding to the second service domain name.
[0195] In a specific embodiment, taking the login status information in the cookie of the target account under the target login domain name as the target login information as an example, specifically, receive the second service domain name and the login information corresponding to the second service domain name sent by the server when the login status information in the cookie of the target account under the target login domain name is valid and it is successful to write the login status information in the cookie of the target account under the target login domain name as the login information corresponding to the second service domain name, and based on the second service domain name and the target login information, jump to the second service page corresponding to the second service domain name.
[0196] In the above embodiment, sending a second access request triggered by a target account for a second service domain name to the server, so that the server can detect whether the target login information is valid when it fails to write the target login information as the login information corresponding to the second service domain name, receiving the second service domain name and the login information corresponding to the second service domain name sent by the server when the target login information is valid and it is successful to write the target login information as the login information corresponding to the second service domain name, and based on the second service domain name and the target login information, jumping to the second service page corresponding to the second service domain name can achieve that regardless of whether there is a failure in writing the login information during the process, as long as the target login information is valid and finally written successfully, the user can smoothly jump to the second service page to achieve seamless access to the service, ensuring the coherence of the user's use of the service.
[0197] In an alternative embodiment, the above method may further include:
[0198] Receive the target login domain name sent by the server when the target login information is invalid;
[0199] Based on the target login domain name, jump to the target login page;
[0200] When it is detected that the target account triggers a login request for the target login domain name for the target login page, send a login request to the server so that the server generates target login information.
[0201] In a specific embodiment, taking the login status information in the session Cookie of the target account under the target login domain name as the target login information, specifically, when the receiving server cannot read the relevant Cookie under the target login domain name, send the target login domain name, based on the target login domain name, jump to the target login page, and when it is detected that the target account triggers a login request for the target login domain name for the target login page, send a login request to the server so that the server generates the session Cookie of the target account under the target login domain name.
[0202] In the above embodiment, based on the target login domain name sent by the server when the target login information is invalid, jump to the target login page, and when it is detected that the target account triggers a login request for the target login domain name for the target login page, send a login request to the server so that the server generates target login information, which can avoid problems caused by invalid login information, thereby reducing the operation burden of the system and improving the overall performance and stability of the system.
[0203] As can be seen from the technical solutions provided in the embodiments of this specification above, in response to a login request for a target login domain triggered during the process of a target account accessing resources on a first service page corresponding to a first service domain name, this specification generates target login information, and the target login information is the login status information of the target account under the target login domain name. The target login domain name is a combined login domain name corresponding to at least one service domain name, and the first service domain name is any one of the at least one service domain names. It is possible to perform login through a unified target login domain name, eliminating the need to develop a separate login function for each service domain name, simplifying the development process, and improving development and operation and maintenance efficiency. After generating the target login information, at least one service domain name is obtained and sent to the terminal corresponding to the target account, so that the terminal automatically triggers a cross-domain request for each of the at least one service domain names. In response to the target cross-domain request sent by the terminal based on the target service domain name, it is detected whether the target login information is valid. The target service domain name is the service domain name that currently triggers the corresponding cross-domain request among the at least one service domain names. In the case where the target login information is valid and there is no corresponding login information for the target service domain name, the target login information is written as the login information corresponding to the target service domain name under the target service domain name. By unifying the login domain names of each business line, it is possible to share the login status of multiple service domain names, enhancing the fluency and coherence of user operations and thus improving the user browsing experience.
[0204] Figure 4 is a block diagram of a cross-domain login device shown according to an exemplary embodiment. Referring to Figure 4 , the device includes:
[0205] A target login information generation module 410, configured to generate target login information in response to a login request for a target login domain triggered during the process of a target account accessing resources on a first service page corresponding to a first service domain name; the target login information is the login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one service domain name; the first service domain name is any one of the at least one service domain names;
[0206] A service domain name sending module 430, configured to obtain at least one service domain name and send the at least one service domain name to the terminal corresponding to the target account, so that the terminal automatically triggers a cross-domain request for each of the at least one service domain names;
[0207] A first detection module 450, configured to detect whether the target login information is valid in response to a target cross-domain request sent by the terminal based on the target service domain name, where the target service domain name is the service domain name that currently triggers the corresponding cross-domain request among the at least one service domain names;
[0208] A target login information writing module 470, configured to write the target login information as the login information corresponding to the target service domain name under the target service domain name when the target login information is valid and there is no corresponding login information for the target service domain name.
[0209] In an optional embodiment, before the target login information generation module 410, the above device further includes:
[0210] A target login domain name acquisition module, configured to acquire a target login domain name in response to a first access request for a first service domain name triggered during a target account's access to resources on a first service page corresponding to the first service domain name when there is no corresponding login information for the first service domain name;
[0211] A first target login domain name sending module, configured to send the target login domain name to the terminal so that the terminal can jump to a target login page based on the target login domain name;
[0212] The target login information generation module 410 includes:
[0213] A target login information generation unit, configured to generate target login information in response to a login request for the target login domain name triggered on the target login page during a target account's access to resources on a first service page corresponding to the first service domain name.
[0214] In an optional embodiment, when writing the target login information as the login information corresponding to the first service domain name fails and the terminal fails to access the first service page, the above device further includes:
[0215] A login detection request receiving module, configured to receive a login detection request automatically triggered by the terminal when the terminal fails to access the first service page;
[0216] A second detection module, configured to detect whether the target login information is valid;
[0217] A first login information writing module, configured to write the target login information as the login information corresponding to the first service domain name under the first service domain name when the target login information is valid.
[0218] In an optional embodiment, the above device further includes:
[0219] A first sending module, configured to send the first service domain name and the login information corresponding to the first service domain name to the terminal so that the terminal can jump to the first service page based on the first service domain name and the target login information.
[0220] In an optional embodiment, the above device further includes:
[0221] A third detection module, configured to respond to a second access request of a target account for a second service domain name, where the second service domain name is any one of at least one service domain name;
[0222] When writing the target login information as the login information corresponding to the second service domain name fails, detect whether the target login information is valid;
[0223] A second sending module, configured to, when the target login information is valid and writing the target login information as the login information corresponding to the second service domain name is successful, send the second service domain name and the login information corresponding to the second service domain name to the terminal, so that the terminal jumps to a second service page corresponding to the second service domain name based on the second service domain name and the target login information.
[0224] In an optional embodiment, the above device further includes:
[0225] A second target login domain name sending module, configured to, when the target login information is invalid, send the target login domain name to the terminal, so that the terminal jumps to a target login page based on the target login domain name and triggers a login request for the target login domain name on the target login page.
[0226] Figure 5 It is a block diagram of a cross-domain login device shown according to an exemplary embodiment. Refer to Figure 5 , the device includes:
[0227] A first login request sending module 510, configured to, when detecting that the target account is accessing resources on a first service page corresponding to a first service domain name, send a login request for a target login domain name to the server, so that the server generates target login information; the target login information is the login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one service domain name; the first service domain name is any one of at least one service domain name;
[0228] A cross-domain request triggering module 530, configured to, when receiving at least one service domain name sent by the server, automatically trigger a cross-domain request for each service domain name in the at least one service domain name;
[0229] A target cross-domain request sending module 550, configured to send a target cross-domain request to the server based on the target service domain name, so that the server detects whether the target login information is valid, and when the target login information is valid and there is no corresponding login information for the target service domain name, write the target login information as the login information corresponding to the target service domain name under the target service domain name; the target service domain name is the service domain name for which the corresponding cross-domain request is currently triggered in the at least one service domain name.
[0230] In an optional embodiment, before the first login request sending module 510, the above device further includes:
[0231] A first access request sending module, configured to send a first access request for the first service domain name to the server during the process of detecting that the target account accesses resources in the first service page corresponding to the first service domain name, so that the server obtains the target login domain name when there is no corresponding login information for the first service domain name.
[0232] A first target jump module, configured to jump to the target login page based on the target login domain name when receiving the target login domain name sent by the server.
[0233] The first login request sending module 510 includes:
[0234] A target login page display module, configured to display the target login page during the process of detecting that the target account accesses resources in the first service page corresponding to the first service domain name.
[0235] A login request sending unit, configured to send a login request to the server when detecting a login request for the target login domain name triggered by the target login page, so that the server generates the target login information.
[0236] In an optional embodiment, when the server fails to write the target login information as the login information corresponding to the first service domain name into the first service domain name and the access to the first service page fails, the above device further includes:
[0237] A login detection request trigger module, configured to send a login detection request that is automatically triggered when the access to the first service page fails to the server, so that the server detects whether the target login information is valid, and when the target login information is valid, writes the target login information as the login information corresponding to the first service domain name under the first service domain name.
[0238] In an optional embodiment, the above device further includes:
[0239] A first service page jump module, configured to jump to the first service page based on the first service domain name and the target login information when receiving the first service domain name and the login information corresponding to the first service domain name sent by the server.
[0240] In an optional embodiment, the above device further includes:
[0241] A second access request sending module, configured to send a second access request triggered by a target account for a second service domain name to a server, so that the server detects whether the target login information is valid when failing to write the target login information as the login information corresponding to the second service domain name; the second service domain name is any one of at least one service domain name;
[0242] A second service page jumping module, configured to receive the second service domain name and the login information corresponding to the second service domain name sent by the server when the target login information is valid and the target login information is successfully written as the login information corresponding to the second service domain name, and jump to the second service page corresponding to the second service domain name based on the second service domain name and the target login information.
[0243] In an optional embodiment, the above device further includes:
[0244] A third target login domain name sending module, configured to receive the target login domain name sent by the server when the target login information is invalid;
[0245] A second target jumping module, configured to jump to the target login page based on the target login domain name;
[0246] A second login request sending module, configured to send a login request to the server when it is detected that the target account triggers a login request for the target login domain name for the target login page, so that the server generates target login information.
[0247] Figure 6 It is a block diagram of an electronic device for cross-domain login shown according to an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as Figure 6 shown. The electronic device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a cross-domain login method.
[0248] Figure 7 It is a block diagram of an electronic device for cross-domain login shown according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as Figure 7As shown in the figure. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it realizes a cross-domain login method. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the electronic device, or an external keyboard, a touchpad, or a mouse, etc.
[0249] Those skilled in the art can understand that Figure 6 or Figure 7 the structure shown in the figure is only a block diagram of some structures related to the solution of the present disclosure, and does not constitute a limitation on the electronic device to which the solution of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine some components, or have a different component arrangement.
[0250] In an exemplary embodiment, an electronic device is further provided, including: a processor; a memory for storing executable instructions of the processor; wherein, the processor is configured to execute the instructions to implement the cross-domain login method as in the embodiment of the present disclosure.
[0251] In an exemplary embodiment, a computer-readable storage medium is further provided. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the cross-domain login method in the embodiment of the present disclosure.
[0252] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily think of other embodiments of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0253] It should be understood that the present disclosure is not limited to the exact structure already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A cross-domain login method, characterized in that, Including: Generating target login information in response to a login request for a target login domain triggered during a target account's access to resources on a first service page corresponding to a first service domain name; The target login information is the login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one service domain name; The first service domain name is any one of the at least one service domain names; Obtaining the at least one service domain name and sending the at least one service domain name to a terminal corresponding to the target account, so that the terminal automatically triggers a cross-domain request for each service domain name in the at least one service domain name; In response to a target cross-domain request sent by the terminal based on a target service domain name, detecting whether the target login information is valid, where the target service domain name is the service domain name for which the current cross-domain request is triggered in the at least one service domain name; In the case where the target login information is valid and there is no corresponding login information for the target service domain name, writing the target login information as the login information corresponding to the target service domain name under the target service domain name.
2. The cross-domain login method according to claim 1, wherein In the case where writing the target login information as the login information corresponding to the first service domain name fails, and the terminal fails to access the first service page, the method further includes: Receiving a login detection request automatically triggered by the terminal when the terminal fails to access the first service page; Detecting whether the target login information is valid; In the case where the target login information is valid, writing the target login information as the login information corresponding to the first service domain name under the first service domain name.
3. The cross-domain login method according to claim 1 or 2, characterized in that, The method further includes: Sending the first service domain name and the login information corresponding to the first service domain name to the terminal, so that the terminal jumps to the first service page based on the first service domain name and the target login information.
4. The cross-domain login method according to claim 1, wherein Before generating the target login information in response to a login request for a target login domain triggered during a target account's access to resources on a first service page corresponding to a first service domain name, the method further includes: In the case where there is no corresponding login information for the first service domain name, in response to a first access request for the first service domain name triggered during a target account's access to resources on a first service page corresponding to the first service domain name, obtaining the target login domain name; Sending the target login domain name to the terminal, so that the terminal jumps to a target login page based on the target login domain name; The generating the target login information in response to a login request for a target login domain triggered during a target account's access to resources on a first service page corresponding to a first service domain name includes: Generating the target login information in response to a login request for a target login domain triggered on the target login page during a target account's access to resources on a first service page corresponding to the first service domain name.
5. The cross-domain login method according to claim 1, wherein The method further includes: In response to a second access request of the target account for a second service domain name, where the second service domain name is any one of the at least one service domain name; When it fails to write the target login information as the login information corresponding to the second service domain name to the second service domain name, detect whether the target login information is valid; When the target login information is valid and it successfully writes the target login information as the login information corresponding to the second service domain name to the second service domain name, send the second service domain name and the login information corresponding to the second service domain name to the terminal, so that the terminal can jump to the second service page corresponding to the second service domain name based on the second service domain name and the target login information.
6. The cross-domain login method according to any one of claims 1 to 5, characterized in that, The method further includes: When the target login information is invalid, send the target login domain name to the terminal, so that the terminal can jump to the target login page based on the target login domain name and trigger a login request for the target login domain name on the target login page.
7. A cross-domain login method, characterized in that Includes: During the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, send a login request for the target login domain name to the server, so that the server generates the target login information; The target login information is the login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one service domain name; the first service domain name is any one of the at least one service domain name; When receiving the at least one service domain name sent by the server, automatically trigger a cross-domain request for each service domain name in the at least one service domain name; Based on the target service domain name, send a target cross-domain request to the server, so that the server can detect whether the target login information is valid, and when the target login information is valid and there is no corresponding login information for the target service domain name, write the target login information as the login information corresponding to the target service domain name under the target service domain name; the target service domain name is the service domain name for which the corresponding cross-domain request is currently triggered in the at least one service domain name.
8. The cross-domain login method according to claim 7, wherein When the server fails to write the target login information as the login information corresponding to the first service domain name to the first service domain name and the access to the first service page fails, the method further includes: Send a login detection request automatically triggered when the access to the first service page fails to the server, so that the server can detect whether the target login information is valid, and when the target login information is valid, write the target login information as the login information corresponding to the first service domain name under the first service domain name.
9. The cross-domain login method according to claim 7 or 8, characterized in that The method further includes: When receiving the first service domain name and the login information corresponding to the first service domain name sent by the server, jump to the first service page based on the first service domain name and the target login information.
10. The cross-domain login method according to claim 7, wherein Before sending a login request for the target login domain name to the server to enable the server to generate target login information during the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, the method further includes: During the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, send a first access request for the first service domain name to the server, so that the server can obtain the target login domain name when there is no corresponding login information for the first service domain name; When receiving the target login domain name sent by the server, based on the target login domain name, jump to the target login page; The step of "During the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, send a login request for the target login domain name to the server to enable the server to generate target login information" includes: During the process of detecting that the target account is accessing resources on the first service page corresponding to the first service domain name, display the target login page; When detecting a login request for the target login domain name triggered by the target login page, send the login request to the server to enable the server to generate target login information.
11. The cross-domain login method according to claim 7, wherein The method further includes: Send a second access request triggered by the target account for the second service domain name to the server, so that the server can detect whether the target login information is valid when writing the target login information as the login information corresponding to the second service domain name fails; the second service domain name is any one of the at least one service domain names; Receive the second service domain name and the login information corresponding to the second service domain name sent by the server when the target login information is valid and writing the target login information as the login information corresponding to the second service domain name is successful, and based on the second service domain name and the target login information, jump to the second service page corresponding to the second service domain name.
12. The cross-domain login method according to any one of claims 7 to 11, characterized in that, The method further includes: Receive the target login domain name sent by the server when the target login information is invalid; Based on the target login domain name, jump to the target login page; When detecting a login request for the target login domain name triggered by the target account for the target login page, send the login request to the server to enable the server to generate the target login information.
13. A cross-domain login device, characterized in that, Includes: A target login information generation module, configured to generate target login information in response to a login request for the target login domain name triggered during the process of the target account accessing resources on the first service page corresponding to the first service domain name; The target login information is the login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one service domain name; the first service domain name is any one of the at least one service domain names; A service domain name sending module, configured to obtain the at least one service domain name and send the at least one service domain name to the terminal corresponding to the target account, so that the terminal automatically triggers a cross-domain request for each service domain name in the at least one service domain name; A first detection module, configured to detect whether the target login information is valid in response to the target cross-domain request sent by the terminal based on the target service domain name, where the target service domain name is the service domain name that currently triggers the corresponding cross-domain request in the at least one service domain name; A target login information writing module, configured to, when the target login information is valid and there is no corresponding login information for the target service domain name, write the target login information as the login information corresponding to the target service domain name under the target service domain name.
14. A cross-domain login device, characterized in that, including: A first login request sending module, configured to send a login request for the target login domain name to the server during the process of detecting that the target account accesses resources in the first service page corresponding to the first service domain name, so that the server generates the target login information; The target login information is the login status information of the target account under the target login domain name; the target login domain name is a combined login domain name corresponding to at least one service domain name; the first service domain name is any one of the at least one service domain names; A cross-domain request triggering module, configured to automatically trigger a cross-domain request for each service domain name in the at least one service domain name when receiving the at least one service domain name sent by the server; A target cross-domain request sending module, configured to send a target cross-domain request to the server based on the target service domain name, so that the server detects whether the target login information is valid, and when the target login information is valid and there is no corresponding login information for the target service domain name, write the target login information as the login information corresponding to the target service domain name under the target service domain name; the target service domain name is the service domain name that currently triggers the corresponding cross-domain request in the at least one service domain name.
15. An electronic device, characterized in that, including: A processor; A memory for storing executable instructions of the processor; Wherein, the processor is configured to execute the instructions to implement the cross-domain login method according to any one of claims 1 to 12.
16. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the cross-domain login method according to any one of claims 1 to 12.