search

Home  >  Q&A  >  body text

angular.js - Can you tell me how to arrange the display of authorized login information on a single page made with Angular?

How to do this idea. Unlike those multi-page jumps. While jumping, various refresh displays are also displayed.

How to verify and display the session permissions on a single page.

phpcn_u1582phpcn_u15822833 days ago571

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