Some questions about the separation of front and rear ends

after logging in for the first time, save the token locally, and then every time you jump to a new page, you have to send a request to the server to verify whether the token is legal, display the page if it is legal, and force you to jump back to the login page if it is illegal?

Jun.15,2022

No additional requests are required, just send them in the header that is placed in the normal business request.


Verification token can determine whether the login has expired


you can refer to the solution of JWT


. The back end mainly provides data, and the front end provides data display and rendering. So before each time you get the data, you should attach the login token to the request header to verify it, and return the correct data if the login information is legal. Then the front-end rendering. If the login information is wrong, the relevant error message is returned, and the front end displays the relevant page according to the error message, such as displaying the login page.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c2f5e3-33c78.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c2f5e3-33c78.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?