doulu8847 2015-08-28 04:04
浏览 212

AngularJS,登录后将用户重定向到正确的页面

My login page of website is made in AngularJS and rest is written in Laravel So I am trying to find out a way to implement the following feature for my website in AngularJS. When user copies a URL from my website, logs out of the session.Subsequently he copy pastes the URL in the browser. It should redirect him to the page he copy pasted after login. At the moment, the behavior is when you copy paste a URL it redirects to login, After login, it redirects to dashboard and not the specific page which was pasted in the browser. Any Ideas in how this can be implemented in Angular at the login page? Thanks All the help much appreciated

  • 写回答

1条回答 默认 最新

  • douzi1350 2015-08-28 04:32
    关注

    The simplest way would be in the interceptor or whatever you have that is redirecting them to the login page, you need to grab the URL and tack it on as a parameter when you redirect to login. Something like '/login?redirect=/other/page'. Then in your login controller you can redirect to that page if the redirect parameter is in the URL, otherwise goto dashboard.

    评论

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算