forked from Gitlink/forgeplus-react
Add Download
This commit is contained in:
parent
c6eb67404a
commit
17c6d94d7e
|
|
@ -112,6 +112,11 @@ class CoderRootFileDetail extends Component {
|
|||
// });
|
||||
};
|
||||
|
||||
DownLoadFile =(url) => {
|
||||
let download_url = "/attachments/entries/get_file?download_url=" + url
|
||||
window.open(download_url)
|
||||
}
|
||||
|
||||
// 编辑文件
|
||||
|
||||
changeMmirror = (e, e1, value) => {
|
||||
|
|
@ -181,9 +186,15 @@ class CoderRootFileDetail extends Component {
|
|||
{flag && (
|
||||
<div>
|
||||
{readOnly ? (
|
||||
<a onClick={() => this.EditFile(false)} className="ml20">
|
||||
<span>
|
||||
<a onClick={() => this.EditFile(false)} className="ml20">
|
||||
<i className="iconfont icon-bianji1 font-15 color-grey-6"></i>
|
||||
</a>
|
||||
<a onClick={() => this.DownLoadFile(detail.download_url)} className="ml20">
|
||||
<i className="iconfont icon-xiazai1 font-15 color-grey-6"></i>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
) : (
|
||||
<React.Fragment>
|
||||
<Select
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
1.请求URL: https://code.ihub.org.cn/api/v1/mirrors/create.json
|
||||
|
||||
2.请求方式: POST
|
||||
|
||||
3.参数:
|
||||
|
||||
{
|
||||
"image_url": "xxx.git", #必填,且后缀必为.git,
|
||||
"language": "Ruby", #必填,如数据库不存在,则会创建新的记录
|
||||
}
|
||||
|
||||
|
||||
4. 返回值: {
|
||||
"status": 1,
|
||||
"message": "同步成功,项目ID===1806"
|
||||
}
|
||||
|
||||
5. 返回值说明: 仅有当有返回值,且返回值的status 的值为1, 才是创建成功,其余均为创建失败
|
||||
|
||||
|
||||
Loading…
Reference in New Issue