Account login switching method and device, server and storage medium

By generating and using login codes for account switching, the problem of low security of account switching based on localStorage client is solved, which enhances the security of account login switching and improves the flexibility of permission management.

CN119232455APending Publication Date: 2024-12-31HUNAN INKE INTERACTIVE ENTERTAINMENT NETWORK INFORMATION CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411342907.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the prior art, the administrator account switching based on the localStorage client has the problem of low security and is vulnerable to the risk of leaking sensitive information caused by XSS attacks.

Method used

By detecting the login switching request sent by the client, we can determine whether the current login account has the target permission to switch to the target account. If possible, generate and store the login code, and send it to the client through the URL to switch to avoid storing sensitive information on the client. , the server-side control account switching logic is used to enhance security.

Benefits of technology

It reduces the risk of sensitive information leakage caused by XSS attacks, enhances the security of account login switching, improves the flexibility of permission checks and account management, and reduces users' troubles due to account security and permission management problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232455A_ABST
    Figure CN119232455A_ABST
Patent Text Reader

Abstract

The invention relates to the field of network communication, and discloses an account login switching method and device, a server and a storage medium. The method comprises the following steps: when a login switching request sent by a client is detected, judging whether a current login account has a target authority of switching to a target account; if the current login account has the target permission, generating a login code according to target account information corresponding to the target account, and storing the login code into a cache; a URL corresponding to the login code is generated, the URL is sent to the client side, and the client side responds to the URL and obtains the login code in a cache so as to execute login switching operation. In the embodiment of the invention, the account switching can be carried out by the user with the legal permission through permission verification by avoiding the situation that sensitive information is stored in the client, using a login code mechanism and adopting a mode that the server side controls the account switching logic, so that the security of account login switching is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communications, and in particular to an account login switching method, device, server and storage medium. Background Art

[0002] In the existing computer system and network security fields, especially in enterprise-level information systems and platforms, switching between multiple administrator accounts is a common requirement.

[0003] Traditional administrator account switching methods mainly rely on localStorage client storage technology to achieve fast login switching. However, XSS (cross-site scripting) attack is a common Web security vulnerability. Attackers can obtain or tamper with data stored in the localStorage client by injecting malicious scripts into Web pages. Therefore, the security of account switching based on the localStorage client is low. Summary of the invention

[0004] The main purpose of the present invention is to solve the technical problem of low security of account switching based on localStorage client.

[0005] A first aspect of the present invention provides a method for switching login of an account, the method comprising:

[0006] When a login switching request sent by the client is detected, it is determined whether the current login account has the target permission to switch to the target account;

[0007] If the current login account has the target permission, generate a login code according to the target account information corresponding to the target account, and store the login code in the cache;

[0008] Generate a URL corresponding to the login code, and send the URL to the client, wherein the client obtains the login code from the cache in response to the URL to perform a login switching operation.

[0009] Optionally, in a first implementation of the first aspect of the present invention, if the current login account has the target authority, the step of generating a login code according to the target account information corresponding to the target account includes:

[0010] If the current login account has the target permission, obtain the target account information corresponding to the target account;

[0011] The login code x is generated according to the unique identifier in the target account information.

[0012] Optionally, in a second implementation of the first aspect of the present invention, the step of determining whether the current login account has the target permission to switch to the target account includes:

[0013] Determine whether the first account type of the current login account is a super account;

[0014] If the first account type is not the super account, determining that the current login account does not have the target permission to switch to the target account;

[0015] If the first account type is the super account, it is determined whether the current login account has the target permission to switch to the target account according to the second account type to which the target account belongs.

[0016] Optionally, in a third implementation of the first aspect of the present invention, if the first account type is the super account, the step of determining whether the current login account has the target permission to switch to the target account according to the second account type to which the target account belongs includes:

[0017] If the first account type is the super account, determining the second account type of the target account;

[0018] If the second account type is the super account, determining that the current login account does not have the target permission to switch to the target account;

[0019] If the second account type is not the super account, it is determined that the current login account has the target permission to switch to the target account.

[0020] Optionally, in a fourth implementation of the first aspect of the present invention, after the step of determining whether the current login account has the target permission to switch to the target account when the login switching request sent by the client is detected, the method further includes:

[0021] If the current login account does not have the target authority, generate a blank login code and store the login code in a cache;

[0022] Generate a URL corresponding to the login code and send the URL to the client, wherein the client responds to the URL and when it determines that the login code does not carry the login code, calls a backup login method to perform a login switching operation.

[0023] Optionally, in a fifth implementation of the first aspect of the present invention, after the step of determining whether the current login account has the target permission to switch to the target account when the login switching request sent by the client is detected, the method further includes:

[0024] If the current login account does not have the target authority, a prompt message indicating that the user has no authority to perform the login switching operation is sent to the client.

[0025] Optionally, in a sixth implementation of the first aspect of the present invention, after the step of generating a URL corresponding to the login code and sending the URL to the client, the method further includes:

[0026] Counting the storage time of the login code in the cache;

[0027] If the storage time reaches a preset time, the login code in the cache is deleted.

[0028] A second aspect of the present invention provides an account login switching device, comprising a memory and a processor, wherein the processor is used to execute program instructions stored in the memory so that the account login switching device executes the above-mentioned account login switching method.

[0029] A third aspect of the present invention provides a server, characterized in that it includes a memory and a processor, and the processor is used to execute program instructions stored in the memory so that the server executes the above-mentioned account login switching method.

[0030] A fourth aspect of the present invention provides a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is run on a computer, the computer executes the above-mentioned account login switching method.

[0031] In an embodiment of the present invention, when a login switching request sent by a client is detected, it is determined whether the current login account has the target authority to switch to the target account; if the current login account has the target authority, a login code is generated according to the target account information corresponding to the target account, and the login code is stored in a cache; a URL corresponding to the login code is generated, and the URL is sent to the client, wherein the client responds to the URL and obtains the login code from the cache to perform a login switching operation. By avoiding storing sensitive information on the client and using a login code mechanism instead, the risk of sensitive information leakage caused by XSS attacks is reduced. The use of a server-side control of the account switching logic makes account management more flexible, facilitates authority verification and account management, and reduces the troubles users have with account security and authority management issues; through authority verification, only users with legitimate authority can switch accounts, which enhances the security of account login switching. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A schematic diagram of an embodiment of a method for switching login of an account in an embodiment of the present invention;

[0033] Figure 2 A schematic diagram of a specific embodiment of step 101 of the method for switching login of an account in an embodiment of the present invention;

[0034] Figure 3 A schematic diagram of a specific embodiment of step 101 of the method for switching login of an account in an embodiment of the present invention;

[0035] Figure 4 A schematic diagram of an embodiment of a login switching device for an account in an embodiment of the present invention;

[0036] Figure 5 FIG. 1 is a schematic diagram of an embodiment of a server in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The embodiments of the present invention provide a method, device, server and storage medium for switching login of an account.

[0038] The embodiments disclosed in the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes and are not intended to limit the scope of protection disclosed in the present invention.

[0039] In the description of the embodiments disclosed in the present invention, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0040] The terms involved in the account login switching method include but are not limited to:

[0041] Account login switching method: a method used to switch different account login states between the client and the server.

[0042] Client: The software or device that users use to log in to their accounts, such as mobile apps, web browsers, etc.

[0043] Login switch request: A request sent by the user to switch from the currently logged-in account to another account.

[0044] Target permissions: permissions required to perform specific operations (such as account switching).

[0045] Target account information: Detailed information related to the target account, such as username, unique identifier, etc.

[0046] Login code: A one-time credential or code used to perform a login switch operation.

[0047] URL (Uniform Resource Locator): Uniform Resource Locator, used to uniquely identify resources on the Internet.

[0048] Account type: A classification standard for different account roles or permissions, such as super accounts, ordinary accounts, etc.

[0049] Super account: An account with higher permissions than a normal account, used for management or advanced operations.

[0050] Storage duration: The length of time that data is stored in the cache.

[0051] Account login switching device: a physical device or virtual device used to execute the account login switching method.

[0052] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the account login switching method in the embodiment of the present invention includes:

[0053] 101. When a login switching request sent by a client is detected, it is determined whether the current login account has the target permission to switch to the target account;

[0054] Specifically, create and maintain an "administrator information table" to store key information of all administrators in the system.

[0055] Define the administrator information fields. The main fields of the administrator information table include:

[0056] User ID: A unique identifier for an administrator account, used to distinguish different administrators.

[0057] Username: The account name used by the administrator to log in to the system.

[0058] User Nickname: The nickname displayed by the administrator in the system, used to identify the administrator.

[0059] Status: The current status of the administrator account (such as "enabled" or "disabled"), which determines whether the account can log in and operate the system.

[0060] IsSuperAdmin: A Boolean field that indicates whether the administrator has super administrator privileges. Super administrators usually have higher privileges and can manage other administrator accounts.

[0061] Load and display the administrator information table. For example, when administrator user A logs in and enters the administrator list page, the information of all administrator accounts is loaded from the administrator information table.

[0062] The administrator list is displayed according to the user ID, user name, user nickname and status. For accounts with the status of "enabled", a quick login button is provided for administrator user A to switch accounts.

[0063] Specifically, the HTTP request from the client in response to the administrator information table is monitored, and when the request contains a specific parameter or identifier for login switching, the request is determined to be a login switching request. The HTTP request can be received based on a Web server (such as Apache, Nginx) combined with a backend framework (such as Spring Boot, Django), and the login switching request can be identified by parsing the request body.

[0064] To verify whether the current login account has the permission to switch to the target account, you can check the permission level, role, or specific permission tag of the current account.

[0065] Optionally, extract the information of the current login account from the session or token. Access the database or permission service to query the permission configuration of the current account. Determine whether the current account has the right to switch to the target account based on the permission configuration.

[0066] Optionally, the client is required to attach a digital signature generated based on the request content and the key when sending the request. The account login switch device verifies the signature to ensure that the request has not been tampered with, increasing security.

[0067] Optionally, based on the client's geographic location, network conditions, or device type, the optimal node is dynamically selected to process the login switching request to improve response speed and stability.

[0068] Optionally, not limited to static permission configuration, real-time data (such as account behavior analysis and risk assessment) can be combined to dynamically evaluate whether the current account has the switching permission.

[0069] Optionally, a multi-factor authentication step can be added to the permission determination process, such as requiring the user to enter an additional verification code, biometric information, etc., to enhance security.

[0070] 102. If the current login account has the target permission, generate a login code according to the target account information corresponding to the target account, and store the login code in a cache;

[0071] Specifically, if the current login account has the target permission, a login code is generated according to the target account information corresponding to the target account, and the login code is stored in the cache. If the current account has permission, a unique login code is generated according to the target account information (such as user name, ID, etc.), and the login code is stored in the cache system of the account login switching device.

[0072] Optionally, use an encryption algorithm (such as hash, UUID) and combine it with the unique information of the target account to generate a login code. Store the login code in a cache system (such as Redis, Memcached).

[0073] Optionally, the storage time of the login code in the cache is counted, and if the storage time reaches a preset time, the login code in the cache is deleted. For example, a preset expiration time is set.

[0074] Optionally, when generating the login code, an encryption algorithm is used in combination with a key management system (KMS) to achieve secure storage of the key.

[0075] Optionally, the generated login code is valid for one time and can be combined with a mobile phone verification code or an email verification code to implement a double verification mechanism.

[0076] 103. Generate a URL corresponding to the login code, and send the URL to the client, wherein the client obtains the login code from the cache in response to the URL to perform a login switching operation.

[0077] Specifically, a URL containing login code information is generated and returned to the client. The client can obtain the login code and perform login switching by accessing the URL.

[0078] Specifically, the login code is encoded as a parameter or fragment of the URL, a complete URL is constructed, and sent to the client through an HTTP response.

[0079] For the client, in response to the URL, the login code is obtained in the cache to perform the login switching operation. For example, after receiving the URL, the client parses the login code and requests the login switching device of the account to use the login code to perform the login switching through a preset mechanism (such as an AJAX request).

[0080] Optionally, the client parses the login code in the URL. Send an HTTP request to the account's login switch device, including the login code as verification information. The account's login switch device verifies the validity of the login code. If valid, it executes the login switch logic, updates the session, and returns a successful response to the client.

[0081] Optionally, the generated URL is converted through a URL shortening service to shorten the URL length and hide the actual login code information to further improve security.

[0082] Optionally, in addition to sending the URL via HTTP response, an instant messaging service (such as WebSocket, FCM) may be used to push the URL to the client in real time, thereby improving the immediacy of the notification.

[0083] Optionally, when verifying the login code, a stateless verification mechanism is used, which does not rely on the session on the account's login switching device. The validity of the login code itself and the key are used to verify the validity of the login code, so as to improve the fault tolerance of the account's login switching device.

[0084] Optionally, automatically manage the cache based on the login code usage frequency and expiration time to improve application performance.

[0085] In an embodiment of the present invention, when a login switching request sent by a client is detected, it is determined whether the current login account has the target authority to switch to the target account; if the current login account has the target authority, a login code is generated according to the target account information corresponding to the target account, and the login code is stored in a cache; a URL corresponding to the login code is generated, and the URL is sent to the client, wherein the client responds to the URL and obtains the login code from the cache to perform a login switching operation. By avoiding storing sensitive information on the client and using a login code mechanism instead, the risk of sensitive information leakage caused by XSS attacks is reduced. The use of a server-side control of the account switching logic makes account management more flexible, facilitates authority verification and account management, and reduces the troubles users have with account security and authority management issues; through authority verification, only users with legitimate authority can switch accounts, which enhances the security of account login switching.

[0086] Traditional login switching methods directly rely on account names and passwords, or use fixed tokens for switching, which are easy to be cracked or forged, and pose security risks. Traditional login switching methods may also use fixed login codes or tokens for switching, which cannot be dynamically generated according to the specific information of the target account, limiting the flexibility of the system. Among the traditional login switching methods, some systems have cumbersome login switching processes, requiring users to perform multiple verifications or enter a large amount of information, which reduces the user experience. In order to solve the above technical problems, the present invention proposes an optional embodiment.

[0087] Reference Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a specific embodiment of step 102 of the method for switching login of an account in an embodiment of the present invention. Step 102 also includes the following specific implementation methods:

[0088] 1021. Determine whether the first account type of the current login account is a super account;

[0089] Specifically, detailed information of the target account (target account information) is retrieved from the database, including but not limited to the unique identifier of the account, the account type, etc.

[0090] 1022. Generate the login code according to the unique identifier in the target account information.

[0091] Specifically, a unique login code is generated based on the unique identifier (such as account ID, UUID, etc.) in the target account information through a preset algorithm (such as hashing, encryption, etc.). The login code is used as a credential for subsequent login switching operations.

[0092] In the embodiment of the present invention, by generating a login code based on the unique identifier of the target account, the uniqueness and unpredictability of the login code are ensured, and the security of the account switching process is improved. The system is allowed to dynamically generate a login code based on the specific information of the target account, which increases the adaptability of the account login switching device.

[0093] In traditional account management systems, switching between accounts often lacks a clear permission control mechanism, or the permission control is too simple and cannot adapt to complex and changing business needs. Specifically, there may be situations where the limits are not clearly divided, such as the blurred boundaries of permissions between different accounts and the lack of clear division standards, leading to abuse or misuse of permissions. There are also situations where security is insufficient, such as the lack of effective security isolation measures, which allows high-privilege accounts (such as super accounts) to access or control other accounts at will, increasing the risk of data leakage. In order to solve the above technical problems, the present invention proposes an optional embodiment.

[0094] Reference Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a specific embodiment of step 101 of the method for switching login of an account in an embodiment of the present invention. Step 101 also includes the following specific implementation methods:

[0095] 1011. Determine whether the first account type of the current login account is a super account;

[0096] Specifically, the attributes or configuration information of the current login account in the database is queried to determine whether it is a super account.

[0097] 1012. If the first account type is not the super account, determine that the current login account does not have the target permission to switch to the target account;

[0098] Specifically, if the current login account is not a super account, it is directly determined that the account does not have the authority to switch to the target account.

[0099] 1013. If the first account type is the super account, determine whether the current login account has the target permission to switch to the target account according to the second account type to which the target account belongs.

[0100] Specifically, if the target account is also a super account, it is determined that the current login account does not have the permission to switch to the target account, because there may be security isolation or special permission management requirements between super accounts.

[0101] If the target account is not a super account, it is determined that the current login account has the authority to switch to the target account, because a super account usually has the authority to manage or access other ordinary accounts.

[0102] In the embodiment of the present invention, by distinguishing account types and limiting direct switching between super accounts, unauthorized account access can be effectively prevented. Super accounts are allowed to switch to ordinary accounts under the premise of complying with preset rules, realizing a flexible permission management mechanism, which is convenient for system administrators to manage and maintain accounts.

[0103] In traditional account management systems, switching between accounts often has no clear permission restrictions, or the permission restrictions are relatively loose, which may lead to security issues. For example, unauthorized users may switch to other accounts in some way and perform unauthorized operations. In addition, the lack of clear permission management may also cause users to feel confused during use. In order to solve the above technical problems, the present invention proposes an optional embodiment.

[0104] Step 1013 also includes the following specific implementations:

[0105] 10131. If the first account type is the super account, determine the second account type of the target account;

[0106] Specifically, it is determined whether the first account type of the current login account is a super account. A super account generally has higher permissions than a normal account and can perform more operations, including switching to other accounts. Whether to allow switching is determined based on the type of the target account.

[0107] 10132. If the second account type is the super account, determine that the current login account does not have the target permission to switch to the target account;

[0108] Specifically, if the second account type of the target account is also a super account, it is determined that the current login account does not have the authority to switch to the target account, because switching between super accounts involves higher-level policy restrictions.

[0109] 10133. If the second account type is not the super account, determine whether the current login account has the target permission to switch to the target account.

[0110] Specifically, if the second account type of the target account is not a super account (i.e., a normal account or other type of account), the current login account is determined to have the authority to switch to the target account. This allows the super account to be flexibly switched to other accounts with lower authority to meet usage requirements in different scenarios.

[0111] In the embodiment of the present invention, by limiting the direct switching between super accounts, potential security risks are prevented. Allowing a super account to switch to a common account meets the usage requirements of different users in different scenarios and improves the flexibility of account login switching. Clarifying the switching permissions between different account types makes permission management clearer.

[0112] In traditional account management systems, account switching is a common requirement. However, how to ensure the security and legality of account switching operations. Traditional account switching methods only implement switching operations through simple verification (such as account passwords), which is vulnerable to various attacks and abuses. In order to solve the above technical problems, the present invention proposes an optional embodiment.

[0113] Step 101 and the following specific implementations are also included:

[0114] 201. If the first account type is the super account, determine the second account type of the target account;

[0115] Specifically, when a login switching request sent by a client is detected and it is determined that the current login account does not have the authority to switch to the target account, a blank login code will be generated. The login code does not contain any valid login information and is only used for processing in subsequent processes. The generated blank login code will be stored in the cache so that subsequent clients can access the login code through the URL.

[0116] 202. If the current login account does not have the target authority, generate a blank login code and store the login code in a cache;

[0117] Specifically, a URL corresponding to the blank login code is generated and sent to the client. After receiving the URL, the client accesses the login code in the cache through it.

[0118] When the client tries to obtain the login code in the cache in response to the URL, it will find that this is a blank login code without any valid login information. At this time, the client will call the backup login method to perform the login switch operation, that is, the user needs to complete the login switch through other methods (such as entering the account password, verification code, etc.).

[0119] Optionally, for other login switching methods, the client can obtain the value of the key admin in the session. If the session value is empty, it means that the user is not logged in, and jump to the login page. If the session value is not empty, it means that the user is logged in, obtain the current logged-in user information, and respond to the request normally.

[0120] Optionally, if the current login account does not have the target authority, a prompt message indicating that the user has no authority to perform the login switching operation is sent to the client to prompt the user to complete the login switching in other ways.

[0121] In the embodiment of the present invention, by limiting the direct switching between super accounts, potential security risks are prevented. Allowing a super account to switch to a common account meets the usage requirements of different users in different scenarios and improves the flexibility of account login switching. Clarifying the switching permissions between different account types makes permission management clearer.

[0122] Reference Figure 4, the embodiment of the present disclosure provides an account login switching device 400, including an account login switching device body, and an account login switching device 405. The account login switching device 405 includes a processor (processor) 404 and a memory (memory) 401 storing program instructions. Optionally, the device may also include a communication interface (Communication Interface) 402 and a bus 403. Among them, the processor 404, the communication interface 402, and the memory 401 can complete mutual communication through the bus 403. The communication interface 402 can be used for information transmission. The processor 404 can call the program instructions in the memory 401 to execute the account login switching method of the above embodiment. In addition, the logical instructions in the above-mentioned memory 401 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. The memory 401, as a computer-readable storage medium, can be used to store software programs, computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 404 executes the functional application and data processing by running the program instructions / modules stored in the memory 401, that is, the login switching method of the account in the above embodiment is realized. The memory 401 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 401 may include a high-speed random access memory and may also include a non-volatile memory.

[0123] Reference Figure 5 , the embodiment of the present disclosure provides a server 500, including a processor (processor) 504 and a memory (memory) 501 storing program instructions. Optionally, the server may also include a communication interface (CommunicationInterface) 502 and a bus 503. Among them, the processor 504, the communication interface 502, and the memory 501 can communicate with each other through the bus 503. The communication interface 502 can be used for information transmission. The processor 504 can call the program instructions in the memory 501 to execute the login switching method of the account in the above embodiment.

[0124] In addition, the logic instructions in the above-mentioned memory 501 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. The memory 501, as a computer-readable storage medium, can be used to store software programs, computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 504 executes functional applications and data processing by running the program instructions / modules stored in the memory 501, that is, implements the login switching method of the account in the above-mentioned embodiment. The memory 501 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 501 may include a high-speed random access memory and may also include a non-volatile memory.

[0125] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.

[0126] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0127] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0128] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0129] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A method for switching login of an account, characterized in that: The account login switching method includes: When a login switching request sent by the client is detected, it is determined whether the current login account has the target permission to switch to the target account; If the current login account has the target permission, generate a login code according to the target account information corresponding to the target account, and store the login code in the cache; Generate a URL corresponding to the login code, and send the URL to the client, wherein the client obtains the login code from the cache in response to the URL to perform a login switching operation.

2. The account login switching method according to claim 1, characterized in that: If the current login account has the target permission, the step of generating a login code according to the target account information corresponding to the target account includes: If the current login account has the target permission, obtain the target account information corresponding to the target account; The login code is generated according to the unique identifier in the target account information.

3. The account login switching method according to claim 1, characterized in that: The step of determining whether the current login account has the target permission to switch to the target account includes: Determine whether the first account type of the current login account is a super account; If the first account type is not the super account, determining that the current login account does not have the target permission to switch to the target account; If the first account type is the super account, it is determined whether the current login account has the target permission to switch to the target account according to the second account type to which the target account belongs.

4. The account login switching method according to claim 3, characterized in that: If the first account type is the super account, the step of determining whether the current login account has the target permission to switch to the target account according to the second account type to which the target account belongs includes: If the first account type is the super account, determining the second account type of the target account; If the second account type is the super account, determining that the current login account does not have the target permission to switch to the target account; If the second account type is not the super account, it is determined that the current login account has the target permission to switch to the target account.

5. The account login switching method according to claim 1, characterized in that: After the step of determining whether the current login account has the target permission to switch to the target account when the login switching request sent by the client is detected, the method further includes: If the current login account does not have the target authority, generate a blank login code and store the login code in a cache; Generate a URL corresponding to the login code and send the URL to the client, wherein the client responds to the URL and when it determines that the login code does not carry the login code, calls a backup login method to perform a login switching operation.

6. The account login switching method according to claim 1, characterized in that: After the step of determining whether the current login account has the target permission to switch to the target account when the login switching request sent by the client is detected, the method further includes: If the current login account does not have the target authority, a prompt message indicating that the user has no authority to perform the login switching operation is sent to the client.

7. The account login switching method according to claim 1, characterized in that: After the step of generating a URL corresponding to the login code and sending the URL to the client, the method further includes: Counting the storage time of the login code in the cache; If the storage time reaches a preset time, the login code in the cache is deleted.

8. A device for switching login of an account, characterized in that: It includes a memory and a processor, and the processor is used to execute program instructions stored in the memory to implement the login switching method of any one of claims 1 to 7.

9. A server, characterized in that: It includes a memory and a processor, and the processor is used to execute program instructions stored in the memory to implement the login switching method of any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the account login switching method according to any one of claims 1 to 7 is implemented.