-
) diff --git a/src/forge/users/Index.jsx b/src/forge/users/Index.jsx index 066d87444..7e209113e 100644 --- a/src/forge/users/Index.jsx +++ b/src/forge/users/Index.jsx @@ -22,21 +22,26 @@ const ProjectDetail = Loadable({ }); export default withRouter( (CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((props) => { + // 个人中心新增的二级目录都需在此添加一次。将项目放组织和个人名下后,此处根据二级目录作判断, let secondRouter = ''; + let firstRouter = ''; if (props.location.pathname) { + firstRouter =props.location.pathname.split('/')[1]; secondRouter = props.location.pathname.split('/')[2]; } + // 如果是explore,把所有路由相关的都改成当前登录人; + let changePathProps={...props}; + if(firstRouter==='explore'){ + let login=props.current_user.login; + changePathProps.match.path=`/${login}`; + changePathProps.match.url=`/${login}`; + changePathProps.location.pathname=`/${login}`; + changePathProps.history.location.pathname=`/${login}`; + } let userRouterArr = ['statistics', 'projects', 'notice', 'devops', 'organizes', 'info', 'watchers', 'fan_users', 'password']; return (