Skip to content

Commit

Permalink
fix: route level default value
Browse files Browse the repository at this point in the history
  • Loading branch information
fecommunity committed Dec 15, 2024
1 parent c39ac61 commit 4aae64e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,6 @@ export function getFirstLevelRoute(path) {
const secondSlashIndex = path.indexOf('/', firstSlashIndex + 1);

// 如果没有找到第二个斜杠,说明路径只有一级
return secondSlashIndex === -1 ? path : path.slice(0, secondSlashIndex);
const finalPath = secondSlashIndex === -1 ? path : path.slice(0, secondSlashIndex);
return finalPath || '/';
}

0 comments on commit 4aae64e

Please sign in to comment.