From d0ccc92cc62fdfc415a6be0e4b78748bc981d3d0 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 25 Mar 2021 22:00:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=A1=B9=E7=9B=AE=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Index.js | 6 ++++++ src/forge/New/Index.js | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/forge/Index.js b/src/forge/Index.js index 58f610642..4874bad33 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -49,6 +49,12 @@ class Index extends Component { )} > + ( + + )} + > ( diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index b130bf79d..e4abc2c0e 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -164,7 +164,7 @@ class Index extends Component { const { projectsType } = this.props.match.params; const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state; const decoderPass = Base64.encode(values.password); - const url = projectsType === "deposit" ? "/projects.json" : "/projects/migrate.json"; + const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json"; axios.post(url, { ...values, auth_password:decoderPass, @@ -179,7 +179,7 @@ class Index extends Component { this.setState({ isSpin: false }) - this.props.showNotification(`${projectsType === "deposit" ? "托管" : "镜像"}项目创建成功!`); + this.props.showNotification(`${projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目创建成功!`); this.props.history.push(`/projects/${owners_name}/${result.data.identifier}`); } } @@ -278,7 +278,7 @@ class Index extends Component { return (
-
创建{projectsType === "deposit" ? "托管" : "镜像"}项目
+
创建{projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目
@@ -303,7 +303,7 @@ class Index extends Component { )} { - projectsType !== "deposit" && + projectsType && projectsType === "mirror" && } { - projectsType !== "deposit" && + projectsType && projectsType === "mirror" &&

需要授权验证

{ @@ -428,7 +428,7 @@ class Index extends Component { )}
{ - projectsType === "deposit" && + (projectsType === "deposit" || !projectsType) && { - projectsType !== "deposit" && + projectsType && projectsType === "mirror" &&