简体   繁体   English

angular 2.0.0成功登录后如何重定向

[英]angular 2.0.0 How to redirect after successfull login

I need to get from the router the prev URL (before the redirect to the login page) Does the Router can give me the prev URL? 我需要从路由器获取上一个URL(在重定向到登录页面之前),路由器可以给我上一个URL吗?

I found some old posts about this subject that are not relevant with the new stable router 3.0.0. 我发现了一些有关此主题的旧帖子,这些帖子与新的稳定路由器3.0.0不相关。

In Angular 2 latest docs. 在Angular 2最新文档中。 They still use this to navigate: 他们仍然使用它来导航:

constructor(private _router: Router, private _location: Location) {}
this._location.back();

Have you tried? 你有没有尝试过?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM