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 ? (
- this.changeStatus("public")}>公有 - this.changeStatus("private")}>私有 -
+ this.changeStatus("public")}>公有 + this.changeStatus("private")}>私有 +