个人中心
This commit is contained in:
parent
6570985b68
commit
1384946620
|
|
@ -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: '/' });
|
||||
|
|
|
|||
|
|
@ -44,10 +44,6 @@ class IndexItem extends Component {
|
|||
</span>:""
|
||||
}
|
||||
</Link>
|
||||
{
|
||||
item.is_public ? "" :
|
||||
<span className="p-r-tags"><span>私有</span></span>
|
||||
}
|
||||
<span className="p-r-tags">
|
||||
<span className="pariseTag"><img src={img_parise} alt="" className="pariseImg" />赞 ({item.praises_count})</span>
|
||||
<span><i className="iconfont icon-fork mr3 font-16" style={{ color: "#1B8FFF" }} />fork ({item.forked_count})</span>
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
</div>
|
||||
<div className="infosType">
|
||||
<div>{category_button}</div>
|
||||
<p className="infoStatus">
|
||||
<span className={is_public === "public" ? "active" : "" } onClick={()=>this.changeStatus("public")}>公有</span>
|
||||
<span className={is_public === "private" ? "active" : "" } onClick={()=>this.changeStatus("private")}>私有</span>
|
||||
</p>
|
||||
{
|
||||
user && current_user && user.login === current_user.login ?
|
||||
<p className="infoStatus">
|
||||
<span className={is_public === "public" ? "active" : "" } onClick={()=>this.changeStatus("public")}>公有</span>
|
||||
<span className={is_public === "private" ? "active" : "" } onClick={()=>this.changeStatus("private")}>私有</span>
|
||||
</p>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
|
||||
{projectsList && projectsList.length > 0 ? (
|
||||
|
|
|
|||
Loading…
Reference in New Issue