angular - 登录后如何在特定路由上重定向?
问题描述
我必须使用 Angular 8 和 Spring Boot 开发一个表单。我对这些技术比较陌生,我需要一些帮助。
提交表单时,必须由架构师对其进行分析。如果架构师验证表单,则更新表单的状态。我已经用 Spring Boot 开发了前端(表单)和 Rest API。现在我有两个问题:
1/ 架构师有自己的界面,最终用户也有自己的界面。我所在的企业使用 Guardian idm 作为身份验证系统。登录后,应用必须知道当前用户是建筑师还是普通用户。
您是否知道如何将此监护人 idm 服务器集成到此 Angular/Spring Boot 应用程序中以及如何进行重定向?
2/ 我不知道如何使用 Angular 和 Spring 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
推荐阅读
- r - 动态计算 R 中 10 年的每月 CAGR
- javascript - 如何在 gatsbyjs 中使用参数创建路由
- date - 日期之间的 Sumifs
- gulp - 你如何配置和使用 gulp eslint 任务?
- ios - UILabel 文本在应该逐字打断时逐字打断
- python - 分发 Pycharm 项目,其模块安装在解释器中,无需接收者/同学安装所述模块
- r - 试图从 LimeSurvey 中提取 R 中的数据。它失败了——为什么?
- ruby - Selenium file_detector 找不到要上传到 selenium 网格的文件
- gradle - 忽略的 Espresso 测试用例未显示在 HTML 测试报告中
- openlayers - 在 CMS processwire 中实现 openlayers - 不显示地图