search

Home  >  Q&A  >  body text

angular.js - angular login verification

Read the session
in the controller and then determine whether to log in, but there is a problem with this. When the judgment is executed, part of the page has already been loaded, and the content can be seen, and then it jumps to the login page.
Yes There is no way to jump directly to the login page.
The judgment is made before the page is loaded

大家讲道理大家讲道理2819 days ago643

reply all(2)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-15 17:09:29

    Reading the session or cookie to determine the login can be placed in the run method of the corresponding module, so that you will not see the page jump after loading part of it

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-15 17:09:29

    To completely prevent the content from being visible, you need to let the backend do it. When entering the page, go to the verification logic of the backend first. If you are logged in after the backend verification, then enter the page directly, otherwise go to the login page. .

    The front-end cannot limit the URL entered by the user, and static resources must be loaded before they can be judged. . .

    reply
    0
  • Cancelreply