Home  >  Q&A  >  body text

angular.js - 能讲讲用Angular做的单页,如何安排授权登录信息那方面的显示

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

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

phpcn_u1582phpcn_u15822684 days ago513

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-05-15 17:03:25

    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.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-15 17:03:25

    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.

    reply
    0
  • Cancelreply