forked from Gitlink/forgeplus-react
新建项目
This commit is contained in:
parent
3bebbdc44d
commit
987688bcc9
|
@ -197,8 +197,6 @@ class Index extends Component {
|
||||||
const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state;
|
const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state;
|
||||||
const decoderPass = Base64.encode(values.password);
|
const decoderPass = Base64.encode(values.password);
|
||||||
const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json";
|
const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json";
|
||||||
// 新建项目的时候,暂存数据,如果失败,返回的时候可以重新赋值
|
|
||||||
sessionStorage.newProjectValue=JSON.stringify({...values,project_language_id,project_category_id,license_id,ignore_id});
|
|
||||||
axios.post(url, {
|
axios.post(url, {
|
||||||
...values,
|
...values,
|
||||||
auth_password:decoderPass,
|
auth_password:decoderPass,
|
||||||
|
@ -208,9 +206,14 @@ class Index extends Component {
|
||||||
ignore_id,
|
ignore_id,
|
||||||
user_id:owners_id
|
user_id:owners_id
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result && result.data.id) {
|
if (result) {
|
||||||
projectsType && projectsType !== "mirror" && this.props.showNotification(`托管项目创建成功!`);
|
if (result.data.id) {
|
||||||
this.props.history.push(`/${result.data.login}/${result.data.identifier}`);
|
this.setState({
|
||||||
|
isSpin: false
|
||||||
|
})
|
||||||
|
this.props.showNotification(`${projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目创建成功!`);
|
||||||
|
this.props.history.push(`/projects/${owners_name}/${result.data.identifier}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpin: false
|
isSpin: false
|
||||||
|
|
Loading…
Reference in New Issue