How can the front-end page written with vue check whether the same account is logged in twice?

to use vue to develop system-based pages, in order to control user permissions and enhance security, it is required that if an account logs in once and is online, the previous account is automatically logged off when logging in again using this account. At present, the data provided to me by the backend are the login ID, "s last login time and whether the data provided by the login IP, can be realized, and how to use vue to monitor whether the account needs to be offline

Mar.05,2021
The function of

is generally controlled by the backend. When the same account logs in again, the session or token that was successfully logged in last time is set to invalidate. What cannot be done at the front end of regenerating a new


is to let the backend return whether you are offline


server, single sign-on control. With the token valid for the last communication


as the front end, I am an interface tuner. I will give you whatever uplink parameters you want for the interface. How does the front end kick the user? The back-end interface tells me that the current user has been kicked, and I will clear the front-end variables for you to jump to the landing page. What else can the front-end do? Is it difficult to send a broadcast to the other end when the user logs in, let them check whether it is a duplicate user and then trigger the offline logic? Of course, it's up to the back end to judge for yourself, and you don't have to do anything. Once the client that is kicked moves again, the next trigger request will automatically call to the landing page.


APIs should have login authentication. The front end makes a unified intercept and jumps to the login page after being logged out. Click a prompt

.
Menu