From 13849466206df24901af2b0e7f22c36582fbf4e7 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 18 Jun 2020 17:32:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/forge/Main/IndexItem.js | 4 ---- src/forge/users/InfosUser.js | 18 +++++++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index 12abacae9..21e7e8073 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -30,7 +30,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '' } function clearAllCookie() { cookie.remove('_educoder_session', { path: '/' }); diff --git a/src/forge/Main/IndexItem.js b/src/forge/Main/IndexItem.js index c9dd41ad8..8d99739d6 100644 --- a/src/forge/Main/IndexItem.js +++ b/src/forge/Main/IndexItem.js @@ -44,10 +44,6 @@ class IndexItem extends Component { :"" } - { - item.is_public ? "" : - 私有 - } 赞 ({item.praises_count}) fork ({item.forked_count}) diff --git a/src/forge/users/InfosUser.js b/src/forge/users/InfosUser.js index 4edf90534..7197bef32 100644 --- a/src/forge/users/InfosUser.js +++ b/src/forge/users/InfosUser.js @@ -34,10 +34,10 @@ class InfosUser extends Component { } }; - get_projects = (is_public) => { + get_projects = (isPublic) => { const { user, project_type } = this.props; const url = `/users/${user && user.login}/projects.json`; - const { page, limit, search, sort_by, category } = this.state; + const { page, limit, search, sort_by, category , is_public } = this.state; this.setState({ isSpin: true, }); @@ -50,7 +50,7 @@ class InfosUser extends Component { sort_by, category, project_type, - is_public:is_public!==undefined ? is_public : "public" + is_public:isPublic!==undefined ? isPublic : is_public }, }) .then((result) => { @@ -218,10 +218,14 @@ class InfosUser extends Component {
{category_button}
-

- this.changeStatus("public")}>公有 - this.changeStatus("private")}>私有 -

+ { + user && current_user && user.login === current_user.login ? +

+ this.changeStatus("public")}>公有 + this.changeStatus("private")}>私有 +

+ :"" + }
{projectsList && projectsList.length > 0 ? (