How does axios determine the user's session timeout?

problem description

the backend now provides an excuse to ask whether the current user"s session has expired, and how can I add it to the whole world, such as when the page stops for that period of time, and then manipulate the page

the environmental background of the problems and what methods you have tried

would you like to ask if this can be added to the global intercept of axios to request this excuse?

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Mar.30,2021

it can be considered that no other interfaces have done session timeout check except this interface

so the local localStorage stores a timestamp to record the last time the session interface was verified. Before each business interface request, check whether there is a certain time difference between the current time and the timestamp stored in the local localStorage. This time should be the session expiration time, or shorter. If you exceed this time limit, first check whether the session has expired and skip login. Otherwise, modify the local timestamp to the current time

.
Menu