添加分支页面匹配

This commit is contained in:
黄心宇 2024-05-09 17:22:07 +08:00
parent abc57d4ac4
commit 21be664fce
2 changed files with 8 additions and 2 deletions

View File

@ -35,6 +35,12 @@ export const deepRoutes = [
onlyHead: true,
// component: Information
},
{
key: "detailBranch",
path: "/:owner/:projectsId/tree/:branchName",
onlyHead: false,
component: Detail,
},
{
key: "detail",
path: "/:owner/:projectsId",

View File

@ -972,9 +972,9 @@ Detail.preFetch = ({ store, match, query }) => {
const promises = [
dispatch(setProjectDetail(match.params)),
dispatch(setProject(match.params)),
dispatch(setProjectEntries({...match.params, branch: ''})),
dispatch(setProjectEntries({...match.params, branch: match.params.branchName ? match.params.branchName : ''})),
dispatch(setProjectMenuList(match.params)),
dispatch(setProjectReadMe({...match.params, branch: ''}))
dispatch(setProjectReadMe({...match.params, branch: match.params.branchName ? match.params.branchName : ''}))
];
const data = await Promise.all(promises);
resolve({