For example, if you go to buy something without logging in, you will be prompted to log in first. Many pages require verification of login before operation? How is it achieved? Background interception?
曾经蜡笔没有小新2017-06-26 10:57:25
Only the backend can maintain login status and status verification.
How to do it? Some use cookies or tokens. The principle is based on session control detection
習慣沉默2017-06-26 10:57:25
Request interface, if the interface returns 401, the front end will jump to the login page
phpcn_u15822017-06-26 10:57:25
What are the pros and cons of using session instead of token in api?
This is something that this community has asked before, I hope it will be helpful to you!