forked from Gitlink/forgeplus-react
url
This commit is contained in:
parent
5565eac601
commit
916cc293ac
|
@ -115,22 +115,23 @@ const DevIndex = Loadable({
|
|||
/**
|
||||
* permission:Manager:管理员,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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue