我不知道如何在查询参数不渲染角度视图的情况下解决这个问题。我已经从后端对字符串进行了编码。
这不起作用:
http://localhost:2333/change-password?token=cfdj8ka%2bqsu
这是可行的:
http://localhost:2333/change-password?token=cfdj8ka
http://localhost:2333/change-password?token=cfdj8kabqsu
我相信%2是/的编码值。我怎样才能让我的Angular路由正确地解码它?我使用的是Angular 5。
发布于 2020-06-12 01:56:22
您可能正在使用this.router.navigate(url),而不是使用url
this.router.navigateByUrl(url);
在构造函数中
constructor(private _route: ActivatedRoute,) {
let token= this._route.snapshot.queryParamMap.get('token');
}https://stackoverflow.com/questions/62329876
复制相似问题