Home  >  Q&A  >  body text

angular.js - angular 登陆验证

在controller中读取session
然后判断是否登陆,但是这样有个问题 , 就是执行判断的时候页面已经加载一部分, 能看到内容,然后才跳转到登陆页面.
有没有什么办法是直接跳到登陆页面的,
在页面加载之前就是判断

大家讲道理大家讲道理2686 days ago560

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