Skip to content

Commit

Permalink
update: 修改readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoushaw committed Nov 23, 2018
1 parent d98d0cc commit fb752d8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 28 deletions.
25 changes: 0 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,6 @@

## mongdob环境搭建

> 安装mongodb
可参考[菜鸟教程](!http://www.runoob.com/mongodb/mongodb-osx-install.html)

```
1、cd /usr/local
2、sudo curl -O https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-4.0.2.tgz
3、sudo tar -zxvf mongodb-osx-ssl-x86_64-4.0.2.tgz
4、sudo mv mongodb-osx-ssl-x86_64-4.0.2.tgz
5、vim ~/.zshrc
#mongo
export MONGO_PATH=/usr/local/mongodb/mongodb-osx-ssl-x86_64-4.0.2.tgz
export PATH=$PATH:$MONGO_PATH/bin
```


> 运行mongodb使用instagram数据库
* sudo mkdir -p /data/db
* mongod --dbpath /data/db
* `无权限使用 sudo mongod --dbpath /data/db`
* `打开另一个命令行窗口`
* mongodb
* use instagram

## 运行web项目

> 安装依赖
Expand Down
11 changes: 10 additions & 1 deletion client/src/components/avatar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,20 @@ class Avatar extends React.Component{
router: PropTypes.object
}

goAbout = () => {
let data = {userId: this.props.userInfo.userId};
let path = {
pathname:'/about',
query:data,
}
this.context.router.history.push(path)
}

render () {
const {userInfo} = this.props
return (
<div className={Style['avatar-content']}>
<div className="avatar" style={{...this.props.avatarStyle,'backgroundImage': `url(${userInfo.avatarUrl}`}}></div>
<div className="avatar" onClick={this.goAbout} style={{...this.props.avatarStyle,'backgroundImage': `url(${userInfo.avatarUrl}`}}></div>
<div className="user_abstract">
<div className={`username ${userInfo.username&&'clear-bg'}`} style={{...this.props.usernameStyle}}>{userInfo.username}</div>
{/* 设置abstract默认为false,可保持背景色 */}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/detail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Detail extends React.Component {
{
!this.state.showAttentionList && this.props.topicList.length > 0?
<div className={Style['home-detail']}>
<DynamicList context={this.props.location}/>
<DynamicList/>
<Recommend togglePostTopic={this.togglePostTopic} followList={this.state.followList} setFollowStatus={this.setFollowStatus}/>
</div>
:
Expand Down
3 changes: 2 additions & 1 deletion service/app/service/topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export default class TopicService extends Service {
const topicDetail = {
userInfo: {
username: user.username,
avatarUrl: user.avatarUrl
avatarUrl: user.avatarUrl,
userId: user.userId
},
topic: {
topicImgList: JSON.parse(topic.topicImg),
Expand Down

0 comments on commit fb752d8

Please sign in to comment.