This commit is contained in:
caishi 2020-11-10 16:56:05 +08:00
parent 2f755e8d65
commit 0712904506
2 changed files with 2 additions and 3 deletions

View File

@ -50,7 +50,6 @@ export default ({ match , history }) => {
});
}
}, [projectsId , owner, sha]);
return (
<div className="main">
<Spin spinning={isSpin}>
@ -60,7 +59,7 @@ export default ({ match , history }) => {
{commit && commit.message &&
<pre className="task-hide" style={{marginBottom:"0px",height:"28px",whiteSpace:"pre-wrap"}}>{commit.message}</pre>
}
<Button type="primary" onClick={()=>{history.push(`/projects/${owner}/${projectsId}?${sha && `branch=${truncateCommitId(sha)}`}`)}} className="ml30">浏览代码</Button>
<Button type="primary" onClick={()=>{history.push(`/projects/${owner}/${projectsId}?branch=${truncateCommitId(sha)}`)}} className="ml30">浏览代码</Button>
</div>
</div>
<div className="f-wrap-between" style={{ alignItems: "center" }}>

View File

@ -3,6 +3,6 @@ export function truncateCommitId(str) {
if (str && str.length > 11) {
return str.substring(0, 10)
}else{
return undefined
return str
}
}