This commit is contained in:
caishi 2021-03-08 11:15:05 +08:00
parent 5565eac601
commit 916cc293ac
1 changed files with 11 additions and 10 deletions

View File

@ -115,22 +115,23 @@ const DevIndex = Loadable({
/**
* permissionManager:管理员Reporter报告人员(只有读取权限)Developer开发人员除不能设置仓库信息外
*/
function checkPathname(pathname){
function checkPathname(projectsId,owner,pathname){
let name = "";
if(pathname){
if(pathname.indexOf("/about")>-1){
if(pathname && pathname !== `/projects/${owner}/${projectsId}`){
let url = pathname.split(`/projects/${owner}/${projectsId}`)[1];
if(url.indexOf("/about")>-1){
name="about"
}else if(pathname.indexOf("/issues")>-1 ||pathname.indexOf("Milepost") > 0){
}else if(url.indexOf("/issues")>-1 ||url.indexOf("Milepost") > 0){
name = "issues";
}else if(pathname.indexOf("/pulls")>-1){
}else if(url.indexOf("/pulls")>-1){
name="pulls"
}else if(pathname.indexOf("/milestones")>-1){
}else if(url.indexOf("/milestones")>-1){
name="milestones"
}else if(pathname.indexOf("/activity")>-1){
}else if(url.indexOf("/activity")>-1){
name="activity"
}else if(pathname.indexOf("/setting")>-1){
}else if(url.indexOf("/setting")>-1){
name="setting"
}else if(pathname.indexOf("/devops")>-1){
}else if(url.indexOf(`/devops`)>-1){
name="devops"
}
}
@ -400,9 +401,9 @@ class Detail extends Component {
const url = this.props.history.location.pathname;
const urlArr = url.split("/");
const urlFlag = (urlArr.length === 3);
let pathname = checkPathname(url);
const { projectsId , owner } = this.props.match.params;
let pathname = checkPathname(projectsId,owner,url);
const { state } = this.props.history.location;