d3george / slash-admin

A modern react admin. It is based on react 18, vite and TypeScript. It's fast !
https://admin.slashspaces.com/
MIT License
1.49k stars 218 forks source link

fix: 修改了路由对/article/:id不支持的情况,对应#28 #36

Closed sincerely1 closed 5 months ago

sincerely1 commented 5 months ago

28 这里个人对匹配方法进行了处理:

不包含":"就没有变化; 当包含“:”,就对字符串按"/"分割,对每部分分别进行比较,跳过开头为":"的部分,简单的几个样例是可以正常处理的,希望大家看下有没有bug

vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
slash-admin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2024 0:54am
d3george commented 5 months ago

你这是在处理什么? /article/:id 指的是/article/aaa这种情况,其中aaa可以理解为文章的id,这个id是动态的

sincerely1 commented 5 months ago

是这样,主要是处理了/article/:id这种动态路由的情况,原版是用路由和当前path判断path否存在,这里主要对上面这种动态情况变化id的情况做了处理。不过感觉 这种处理有点呆,想问一大家有没有其他处理方法

d3george commented 5 months ago

解决方案,可以看下这个提交 https://github.com/d3george/slash-admin/commit/98ad16f787c27bc2f2415ec24c4864def446c084