CN110888694A - Method for realizing free switching of system user accounts based on localStorage - Google Patents

Method for realizing free switching of system user accounts based on localStorage Download PDF

Info

Publication number
CN110888694A
CN110888694A CN201911232084.0A CN201911232084A CN110888694A CN 110888694 A CN110888694 A CN 110888694A CN 201911232084 A CN201911232084 A CN 201911232084A CN 110888694 A CN110888694 A CN 110888694A
Authority
CN
China
Prior art keywords
user
localstorage
information
background
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911232084.0A
Other languages
Chinese (zh)
Other versions
CN110888694B (en
Inventor
滕春旭
杨冰
孔庆明
黄嘉诚
朱学坤
张琦玉
王东勋
徐晓瑀
罗义斌
孙力斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Lianchuang Digital Technology Co.,Ltd.
Original Assignee
Nanjing Lian Internet Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Lian Internet Technology Co Ltd filed Critical Nanjing Lian Internet Technology Co Ltd
Publication of CN110888694A publication Critical patent/CN110888694A/en
Application granted granted Critical
Publication of CN110888694B publication Critical patent/CN110888694B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method for realizing free switching of system user accounts based on localStorage, which is characterized in that a localStorage file is adopted to store user information when users log in based on the storage characteristics of localStorage, when a super administrator A intervenes or helps a common user B to operate a system, the user information in the localStorage file of the super administrator A of the system is replaced by the user information of the common user B, and therefore the method is equivalent to that the common user B performs system operation, records logs in a background and other all operations related to the user information, cannot be changed, records the information of the common user B, and can perfectly solve the problems of loss and confusion of system or website operation records.

Description

Method for realizing free switching of system user accounts based on localStorage
Technical Field
The invention relates to a technology for switching user accounts in a website or a system, in particular to a method for realizing free switching of system users based on localStorage.
Background
Since a system super administrator a is often needed to help a general user B to handle background operation requirements in the process of making a website or a system, we can make an assumption: if the system super administrator a directly intervenes in the operation, the log recorded by the system is the operation of the system super administrator a. When a common user B logs in the system later to check the operation logs, the corresponding logs cannot be checked, but the operation is already performed, so that the security of the system is suspected, and meanwhile, accurate user operation data cannot be obtained when the system or website operation logs are counted later.
In order to solve the problems of loss and confusion of the operation records of the system or the website, an account switching function is used. Therefore, how to quickly and effectively switch accounts to achieve the purpose of system super administrators intervening or helping ordinary users to operate the system without disturbing the integrity of system data is a problem which needs to be actually faced in design.
Disclosure of Invention
The purpose of the invention is as follows: the invention aims to provide a method for realizing free switching of system user accounts based on localStorage, so that a system super administrator A can not disturb the integrity of system data when switching roles, authorities and the like of a common user B.
The technical scheme is as follows: in order to achieve the technical effects, the invention provides the following technical scheme:
a method for realizing free switching of system user accounts based on localStorage is characterized by comprising the following steps:
(1) the method comprises the steps that a system foreground establishes a localStorage file for each user needing to store user information respectively, and stores corresponding user information in the localStorage file;
(2) when the super administrator A intervenes or helps the common user B to operate the system, the super administrator A calls an interface of the system background switching common user B;
(3) when receiving a user switching request, a system background judges whether a requester is a system super manager A, if so, the background switches the session or cookie content of the super manager A recording user information into the user information of a common user B, and then returns the user information of the common user B to the super manager A; if not, the system background returns a prompt of incapability of switching to the super administrator A;
(4) after receiving the user information of the common user B returned by the background, the system foreground backs up the user information in the localStorage file C of the super administrator A to a new localStorage file C*Performing the following steps; then, replacing the user information in the localStorage file C of the super administrator A with the user information of the common user B returned by the background;
(5) when the operation of the system super manager A is finished and the identity is switched back, the backup is acquired firstlylocalStorage file C*Judgment of C*Whether there is a value; if the current user is switched by the system super manager A, the system super manager A is switched back at the moment, the session or cookie content, which is stored by the common user B at the moment and records the user information, of the background is switched into the user information of the super manager A by calling a background interface, the information of the super manager A is returned and stored in a localStorage file C, the information of the common user B is stored before being replaced, and the localStorage file C is emptied from the foreground*(ii) a If the value is not the same, judging that the current user is not switched by the system super administrator A or the login information is invalid, and prompting to log in again.
Furthermore, before the super administrator a intervenes or helps the operating system of the common user B, the super administrator a searches the identity information of the common user B, queries the database through the background code to find the common user B, and obtains the identity label of the common user B.
Further, the system searches for the common user B through an identity which can uniquely confirm the identity of the user, wherein the identity comprises a user name, an ID, a role and authority.
Has the advantages that: compared with the prior art, the invention has the following advantages:
based on the storage characteristic of the localStorage, the user information of the user login is stored by adopting the localStorage file, when the super administrator A intervenes or helps the common user B to operate the system, the user information in the localStorage file of the super administrator A of the system is replaced by the user information of the common user B, which is equivalent to that the common user B performs system operation, all operations related to the user information, such as background log recording, and the like, cannot be changed, the information of the common user B is recorded, and the problems of loss and disorder of system or website operation records can be perfectly solved.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The technical scheme of the invention is further explained by combining the attached drawings and the detailed embodiment.
Example (b): fig. 1 is a flowchart of the present embodiment, which includes the following steps:
step one, a system super manager A can uniquely confirm the condition of the common user B by searching the input user name, ID and the like to inquire the corresponding common user B.
And step two, the system super administrator A calls an interface of the background switching common user B.
And step three, the background receives a user switching request, judges whether the role of the user requesting the user is a system super manager A, if so, switches the session or cookie of the background system super manager A for recording the user information into the user information of a common user B, and returns the user information of the common user B, and if not, returns a prompt of incapability of switching.
Step four, backing up the user information in the localStorage file C of the foreground existing system super manager A to a new localStorage file C*In (1).
And step five, replacing the user information in the localStorage file C of the foreground existing system super administrator A with the information of the common user B returned by the background.
Step six, when the operation of the system super administrator A is finished and the system super administrator A wants to switch back to the identity, firstly, a backup localStorage file C is obtained*Judgment of C*Whether there is a value; if the current user is switched by the system super manager A, the system super manager A is switched back at the moment, the session or cookie content, which is stored by the common user B at the moment and records the user information, of the background is switched into the user information of the super manager A by calling a background interface, the information of the super manager A is returned and stored in a localStorage file C, the information of the common user B is stored before being replaced, and the localStorage file C is emptied from the foreground*(ii) a If the value is not the same, judging that the current user is not switched by the system super administrator A or the login information is invalid, and prompting to log in again.
In the process of the above operation steps, since the localStorage of the system super administrator a has been switched to the information of the ordinary user B, it is equivalent to that the ordinary user B performs system operation, all operations related to user information, such as log recording in the background, etc., will not be changed, and the information of the ordinary user B will be recorded, so that the problem of loss and confusion of system or website operation records is perfectly solved.
The above description is only of the preferred embodiments of the present invention, and it should be noted that: it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the invention and these are intended to be within the scope of the invention.

Claims (3)

1. A method for realizing free switching of system user accounts based on localStorage is characterized by comprising the following steps:
(1) the method comprises the steps that a system foreground establishes a localStorage file for each user needing to store user information respectively, and stores corresponding user information in the localStorage file;
(2) when the super administrator A intervenes or helps the common user B to operate the system, the super administrator A calls an interface of the system background switching common user B;
(3) when receiving a user switching request, a system background judges whether a requester is a system super manager A, if so, the background switches the session or cookie content of the super manager A recording user information into the user information of a common user B, and then returns the user information of the common user B to the super manager A; if not, the system background returns a prompt of incapability of switching to the super administrator A;
(4) after receiving the user information of the common user B returned by the background, the system foreground backs up the user information in the localStorage file C of the super administrator A to a new localStorage file C*Performing the following steps; then, replacing the user information in the localStorage file C of the super administrator A with the user information of the common user B returned by the background;
(5) when the operation of the system super administrator A is finished and the system super administrator A wants to switch back to the identity, a backup localStorage file C is obtained first*Judgment of C*Whether there is a value; if the value is positive, the current user is switched by the system super manager A, and the system super manager A is switched back at the momentCalling a background interface, switching the session or cookie content of the user information recorded by the common user B stored in the background into the user information of the super administrator A, returning the information of the super administrator A, storing the information in a localStorage file C, replacing the information of the common user B stored in the background before, and clearing the localStorage file C from the foreground*(ii) a If the value is not the same, judging that the current user is not switched by the system super administrator A or the login information is invalid, and prompting to log in again.
2. The method for realizing free switching of system user accounts based on localStorage according to claim 1, wherein before intervening or helping an operating system of a common user B, a super administrator a searches identity information of the common user B, queries a database through a background code to find the common user B, and obtains an identity of the common user B.
3. The method for realizing free switching of system user accounts based on localStorage according to claim 1, wherein the system searches for a common user B through an identity which can uniquely confirm the identity of the user, and the identity includes a user name, an ID, a role and a right.
CN201911232084.0A 2019-10-31 2019-12-04 Method for realizing free switching of system user accounts based on localStorage Active CN110888694B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911049955 2019-10-31
CN2019110499555 2019-10-31

Publications (2)

Publication Number Publication Date
CN110888694A true CN110888694A (en) 2020-03-17
CN110888694B CN110888694B (en) 2020-08-28

Family

ID=69750547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911232084.0A Active CN110888694B (en) 2019-10-31 2019-12-04 Method for realizing free switching of system user accounts based on localStorage

Country Status (1)

Country Link
CN (1) CN110888694B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070162574A1 (en) * 2006-01-06 2007-07-12 Apple Computer, Inc. Data serialization in a user switching environment
CN105631266A (en) * 2015-12-28 2016-06-01 上海赞越软件服务中心 Mechanism for achieving multi-user switching through jQuery shell
CN106529324A (en) * 2016-09-06 2017-03-22 北京三快在线科技有限公司 Method and device for switching user identity
CN107015718A (en) * 2016-01-27 2017-08-04 广州知商互联网科技有限公司 A kind of network platform user identity one key switching method
CN108683679A (en) * 2018-05-30 2018-10-19 深圳壹账通智能科技有限公司 More account login methods, device, equipment and the storage medium of Web APP
US20190332710A1 (en) * 2018-04-27 2019-10-31 Dropbox, Inc. Selectively identifying and recommending digital content items for synchronization

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070162574A1 (en) * 2006-01-06 2007-07-12 Apple Computer, Inc. Data serialization in a user switching environment
CN105631266A (en) * 2015-12-28 2016-06-01 上海赞越软件服务中心 Mechanism for achieving multi-user switching through jQuery shell
CN107015718A (en) * 2016-01-27 2017-08-04 广州知商互联网科技有限公司 A kind of network platform user identity one key switching method
CN106529324A (en) * 2016-09-06 2017-03-22 北京三快在线科技有限公司 Method and device for switching user identity
US20190332710A1 (en) * 2018-04-27 2019-10-31 Dropbox, Inc. Selectively identifying and recommending digital content items for synchronization
CN108683679A (en) * 2018-05-30 2018-10-19 深圳壹账通智能科技有限公司 More account login methods, device, equipment and the storage medium of Web APP

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HOWIEYI: "微信活动页开发中的遇到的坑", 《HTTPS://WWW.JIANSHU.COM/P/EB183F262033》 *
MATT RAIBLE: "Use Okta (Instead of Local Storage) to Store Your User"s Data Securely", 《HTTPS://DEVELOPER.OKTA.COM/BLOG/2018/01/23/REPLACE-LOCAL-STORAGE-WITH-OKTA-PROFILE-ATTRIBUTES》 *

Also Published As

Publication number Publication date
CN110888694B (en) 2020-08-28

Similar Documents

Publication Publication Date Title
US11314458B2 (en) Global de-duplication of virtual disks in a storage platform
EP3352433B1 (en) Node connection method and distributed computing system
EP2863310B1 (en) Data processing method and apparatus, and shared storage device
CN105930228A (en) data backup method and system
US8255366B1 (en) Segment-based method for efficient file restoration
CN101867607A (en) Distributed data access method, device and system
US8706856B2 (en) Service directory
CN101771723A (en) Data synchronization method
US10509716B2 (en) Automated recovery of flighted features based on service requests
US11221993B2 (en) Limited deduplication scope for distributed file systems
CN110245145A (en) Structure synchronization method and apparatus of the relevant database to Hadoop database
CN106571968B (en) Service switching method and system
US20110302138A1 (en) Network aware storage device
CN101778131A (en) Data synchronization system
CN108900337B (en) Fault recovery method, server, client and system for metadata service
CN111026711A (en) Block chain based data storage method and device, computer equipment and storage medium
GB2510429A (en) Assessing response routes in a network
EP3269098B1 (en) Large data management in communication applications through multiple mailboxes
CN101789963A (en) Data synchronization system
US11829630B2 (en) Synthetically providing multiple types of granular delete operations for a cloud-based object storage
CN110888694B (en) Method for realizing free switching of system user accounts based on localStorage
CN113407356A (en) Data processing method and device, electronic equipment and storage medium
US20180020075A1 (en) Apparatus and method for providing data based on cloud service
CN106776131A (en) A kind of data back up method and server
CN116069810A (en) Data query method and device and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 210019 4th floor, building 1, 69 Aoti street, Jianye District, Nanjing City, Jiangsu Province

Patentee after: Nanjing Lianchuang Digital Technology Co.,Ltd.

Address before: 210019 4th floor, building 1, 69 Aoti street, Jianye District, Nanjing City, Jiangsu Province

Patentee before: NANJING LIANCHUANG INTERNET TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A Method for Implementing Free Switching of System User Accounts Based on LocalStorage

Granted publication date: 20200828

Pledgee: Bank of China Limited by Share Ltd. Jiangsu branch

Pledgor: Nanjing Lianchuang Digital Technology Co.,Ltd.

Registration number: Y2024980015503