angular.js - How does Angular prevent users from accessing pages through addresses without logging in?
巴扎黑
巴扎黑 2017-05-27 17:44:25
0
3
788

For the designed page, you must log in first before you can use the functions on the page. If you are not logged in, is it possible to enter the page directly through the address link?

巴扎黑
巴扎黑

reply all(3)
左手右手慢动作

Actually, when entering each page, you should check whether you need to log in and whether you have logged in. If not, jump to the login page.

世界只因有你

Verification is performed uniformly at the router location. Before the router jumps, it determines whether you are logged in. If you are not logged in, jump to the login page

曾经蜡笔没有小新

If it is an architecture with completely separated front-end and back-end: When the user opens the page for the first time, he first goes to the back-end to obtain the user information (to determine whether to log in);
As for the login verification method: Normally, after successful login, a cookie will be stuffed. a session. The browser will automatically bring this cookie every time it sends a request to the backend. Another verification method is a custom token.
In other words, requests for front-end and back-end data interaction are all back-end verification cookies or tokens, and do not require front-end verification.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template