diff --git a/src/scripts/components/Common/PlayMainHeader/PlayMainHeader.jsx b/src/scripts/components/Common/PlayMainHeader/PlayMainHeader.jsx index c7062d0..1263cc6 100644 --- a/src/scripts/components/Common/PlayMainHeader/PlayMainHeader.jsx +++ b/src/scripts/components/Common/PlayMainHeader/PlayMainHeader.jsx @@ -10,6 +10,7 @@ class PlayMainHeader extends Component { } } this.addToy = this._addToy.bind(this) + this.addDraft = this._addDraft.bind(this) } componentWillMount() { !this.props.loaded && this.props.fetchInfo() @@ -22,6 +23,17 @@ class PlayMainHeader extends Component { }) } } + _addDraft() { + if(confirm('创建一个新草稿?')){ + Request + .post(`/api/recommend?place=draft`) + .end((err,res) => { + if(!err){ + this.props.history.push(`/recommend/${res.body.id}`) + } + }) + } + } render() { const { nickName, avatar, email } = this.props.user return( @@ -58,7 +70,7 @@ class PlayMainHeader extends Component { - Actions + 操作 @@ -95,6 +107,18 @@ class PlayMainHeader extends Component { +