angular.js - 能讲讲用Angular做的单页,如何安排授权登录信息那方面的显示
phpcn_u1582
phpcn_u1582 2017-05-15 17:01:25
0
2
511

这思路是怎么做的。不同于那些多页面跳转。跳转的同时也各种刷新显示了。

单页面如何做好那个session权限验证显示呢。

phpcn_u1582
phpcn_u1582

reply all(2)
Peter_Zhu

You use ajax to access an interface for checking login on the server, and then get the user information by the way, save the user information in a rootscope variable, and then judge this variable in the template to display please log in, or user name, avatar, etc. information. This is basically the idea.

淡淡烟草味

If the front-end and back-end are separated, the backend will definitely provide you with relevant interfaces. You can store the user session identifier returned by the backend, such as token, when the login is successful, and verify whether the token is used when doing other related interactions with the backend. Expiration, whether there are permissions, etc., seal the verification function into the service for public use.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!