diff --git a/src/forge/Main/Diff.jsx b/src/forge/Main/Diff.jsx index 6556023e..8dad59fb 100644 --- a/src/forge/Main/Diff.jsx +++ b/src/forge/Main/Diff.jsx @@ -21,8 +21,8 @@ const Infos = styled.div` & .markdown-body table{ background: #f1f8ff; } - & .f-wrap-between{ - align-items: center; + & .btnblue{ + margin-top: 12px; } & .task-hide{ width: 65rem; diff --git a/src/forge/Merge/CreateMerge.js b/src/forge/Merge/CreateMerge.js index 0f685907..c335d79f 100644 --- a/src/forge/Merge/CreateMerge.js +++ b/src/forge/Merge/CreateMerge.js @@ -96,7 +96,6 @@ class CreateMerge extends Component { // 再获取对应的仓库列表、分支列表 // 再调用比较接口 const branchParams = getBranchParams(this.props.location.pathname); - console.log('componentDidMount branchParams', branchParams); this.getMergeInfo(branchParams); }; @@ -106,7 +105,6 @@ class CreateMerge extends Component { const newPathname = this.props.location.pathname; if (oldPathname !== newPathname) { const branchParams = getBranchParams(newPathname); - console.log('componentDidUpdate branchParams', branchParams); this.getMergeInfo(branchParams); } }; @@ -142,22 +140,29 @@ class CreateMerge extends Component { pull: pullBranch, }); - if (!noMergeBranch && !noPullBranch) { - this.compareProject(result.data.id, branchParams); - } else { - const _message = []; - noMergeBranch && _message.push('目标分支不存在'); - noPullBranch && _message.push('源分支不存在'); + //判断源分支是否存在 + if(noPullBranch){ this.setState({ showMessage: true, - defaultMessage: _message.join(' , '), + defaultMessage:'源分支不存在', isCompareSpin: false, }); + }else{ + if(pullOwner === mergeOwner){ + if (!noMergeBranch) { + this.compareProject(result.data.id, branchParams); + } else { + this.setState({ + showMessage: true, + defaultMessage:'目标分支不存在', + isCompareSpin: false, + }); + } + }else{ + this.getBranchList(branchParams); + } } } - if (pullOwner !== mergeOwner) { - this.getBranchList(branchParams); - } this.setState({ isSpin: false }); }) .catch((error) => { @@ -225,7 +230,9 @@ class CreateMerge extends Component { .length === 0; this.setState({ mergeBranches: result.data, - merge: noMergeBranch ? 'master' : mergeBranch, + showMessage: noMergeBranch, + defaultMessage: '目标分支不存在', + isCompareSpin: false, }); } this.setState({ isSpin: false });