🐛 [BUG] cli 搭建项目运行报路由错误
MomoKiller opened this issue · 1 comments
MomoKiller commented
🐛 bug 描述
使用cli 搭建的项目,安装好依赖后运行。报以下路由信息错误。
Uncaught Error: Absolute route path "/*" nested under path "/user" is not valid. An absolute child route path must start with the combined path of all its parent routes.
📷 复现步骤 | Recurrence steps
🏞 期望结果 | Expected results
项目正常运行,通过账号密码登录进项目首页
💻 复现代码 | Recurrence code
config/routees.ts 文件中 /user 子路由中有路由会报错,注释掉后正常
{
component: '404',
path: '/*',
},
© 版本信息
- Ant Design Pro 版本: [e.g. 4.0.0]
- umi 版本
- 浏览器环境
- 开发环境 [e.g. mac OS]
🚑 其他信息
MomoKiller commented
router 中最一级路由已经有 /* 路由,而在 /user 子路由中重复出现。
/user 子路由需要补齐 path 参数信息。
将
{
component: '404',
path: '/',
},
改成
{
component: '404',
path: '/user/',
},