新建文件接口

This commit is contained in:
caicai8 2020-03-25 17:52:13 +08:00
parent 9e4254e01f
commit 7a8b028aeb
3 changed files with 6 additions and 6 deletions

View File

@ -294,9 +294,9 @@ class CoderRootDirectory extends Component{
<div className="f-wrap-alignCenter">
{
subFileType !== "file" && (isManager || isDeveloper) &&
<p className="addFile">
<p className="addFile mr30">
<Link to={`/projects/${projectsId}/coders/${branch}/newfile${urlRoot}`} >新建文件</Link>
<Link to={``}>上传文件</Link>
{/* <Link to={``}>上传文件</Link> */}
</p>
}
{

View File

@ -442,10 +442,10 @@ body,#root{
padding: 0px 10px;
}
.addFile a:first-child{
border-radius: 4px 0px 0px 4px;
border-radius: 4px;
}
.addFile a:last-child{
border-radius: 0px 4px 4px 0px;
/* border-radius: 0px 4px 4px 0px; */
border-left: 1px solid rgba(247, 247, 247, 0.3);
}
.addFile a:active{

View File

@ -22,13 +22,13 @@ class UserSubmitComponent extends Component{
// 提交变更
subMitFrom=()=>{
const { current_user , filepath , content } = this.props;
const { filepath , content } = this.props;
const { branch , projectsId } = this.props.match.params;
const { submitType } = this.state;
let path = filepath.substr(1);
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const url = `/${current_user && current_user.login}/${projectsId}/contents.json`;
const url = `/repositories/${projectsId}/create_file.json`;
axios.post(url,{
filepath:path,
branch:submitType==="0" ? branch : undefined,