angular - Angular Route 部分通配符
问题描述
当一个链接像这样进来时:mysite.com/_/somethingThatChangesRandomly
我希望将其重定向到登录页面,因此规则是“路径以_开头”:
{
path: '_/**', redirectTo: "login"
}
但我收到一个错误:
Cannot match any routes. URL Segment: '_/somethingThatChangesRandomly'
解决方案
{
path: '_',
children: [
{
path: "**",
redirectTo: "/login"
}
]
}
推荐阅读
- php - 通过 hasManyThrough Laravel Eloquent 获取多个表
- python - 如何使用 python API 将文件嵌入到数据流作业中
- python - Django 管理操作:仅使用一种方法为所有选择生成操作
- android - 启动时重新启动服务 8.1 问题
- android - 房间数据库中的外键
- c# - 如何使用 DisplayFormat 属性格式化表中的值?
- javascript - 在 Firebase 中存储注册数据
- c++ - 如何使用单个返回语句返回对变量的引用
- python - 硒python返回所有输出
- php - abraham/twitteroauth 在实体-> urls 中看不到 [unwound] 对象