当我们在角度8路由器中使用功能模块时重新加载问题

当尝试通过浏览器或使用window.location.reload刷新当前路由时。应用程序导航回到主页(登录页面)。它应该重新加载相同的URL。我们尚未在应用程序中使用身份验证保护。尽管使用了LocationStrategy,但使用了HashLocationStrategy。

const currentUrl = window.location.href;
const vizUrl = currentUrl.split('#')[1]; 
this.router.navigateByUrl('/',{ skipLocationChange: true }).then(() => 
  { this.router.navigate([vizUrl]); }); 

vizUrl是我们要重新加载/刷新的路线

jiao860809 回答:当我们在角度8路由器中使用功能模块时重新加载问题

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3159104.html

大家都在问