首页 > 解决方案 > 登录后如何在特定路由上重定向?

问题描述

我必须使用 Angular 8 和 Spring Boot 开发一个表单。我对这些技术比较陌生,我需要一些帮助。

提交表单时,必须由架构师对其进行分析。如果架构师验证表单,则更新表单的状态。我已经用 Spring Boot 开发了前端(表单)和 Rest API。现在我有两个问题:

1/ 架构师有自己的界面,最终用户也有自己的界面。我所在的企业使用 Guardian idm 作为身份验证系统。登录后,应用必须知道当前用户是建筑师还是普通用户。

您是否知道如何将此监护人 idm 服务器集成到此 Angular/Spring Boot 应用程序中以及如何进行重定向?

2/ 我不知道如何使用 Angular 和 Spring Boot 更改提交表单的状态。当我说“表单状态”时,我的意思是“已验证”或“未验证”或“正在验证”。提交表单的用户必须看到他提交的步骤。

我做了一些研究,但我什么也没看到。拜托,你能帮帮我吗?谢谢。

标签: angularformsspring-boot

解决方案


您可以使用 Angular Route Guards 来满足您的要求。下面是一点点。

Angular’s route guards are interfaces which can tell the router whether or not it should allow navigation to a requested route. They make this decision by looking for a true or false return value from a class which implements the given guard interface.

您可以在下面的精彩文章中找到更多信息。 https://medium.com/@ryanchenkie_40935/angular-authentication-using-route-guards-bf7a4ca13ae3


推荐阅读