This commit is contained in:
谢思 2021-09-27 13:09:59 +08:00
parent 55f3bc6201
commit 44d529e867
2 changed files with 7 additions and 4 deletions

View File

@ -157,7 +157,7 @@ class CoderRootCommit extends Component{
<div className="commitList-item f-wrap-between">
<div>
<AlignTop>
<div className="commitDesc"><Link to={{pathname:`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`, query:{commitpage:page}}} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
<div className="commitDesc"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?page=${page}`} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
</AlignTop>
<p className="f-wrap-alignCenter mt15">
<User
@ -174,7 +174,7 @@ class CoderRootCommit extends Component{
<div>
<span className="treecopy-cont shadow">
<img src={Tree} alt="sha" width={"16px"}/>
<Link to={{pathname:`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}`, query:{commitpage:page}}}>{truncateCommitId(`${item.sha}`)}</Link>
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}/${branch}?page=${page}`}>{truncateCommitId(`${item.sha}`)}</Link>
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`} disabled/>
</span>
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>

View File

@ -43,14 +43,17 @@ const Infos = styled.div`
}
`;
//
export default ( match , history, location) => {
export default ( location) => {
console.log(match);
const {match , history } = props;
const [data, setData] = useState({undefined});
const [commit, setCommit] = useState(undefined);
const [parents, setParents] = useState(undefined);
const [committer, setCommitter] = useState(undefined);
const [isSpin, setIsSpin] = useState(true);
console.log('----------', location && location.query && location.query.commitpage);
const { sha , projectsId, owner, branchName } = match.params;
const { sha , projectsId, owner, branchName } = match && match.params;
console.log(sha);
useEffect(() => {
if (projectsId && owner && sha) {
const url = `/${owner}/${projectsId}/commits/${sha}.json`;