From 159e7e9e5cdd1b70c9570158eaf3f30e8bf13184 Mon Sep 17 00:00:00 2001 From: DsAco <2363140194@qq.com> Date: Mon, 16 Oct 2017 18:46:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=A0=87=E7=AD=BEuploadkey?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E9=A6=96=E9=A1=B5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=9B=E5=BB=BAbanner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/PlayMainHeader/PlayMainHeader.jsx | 26 ++++++++++++++++++- src/scripts/components/EditTag/EditTag.jsx | 4 +-- 2 files changed, 27 insertions(+), 3 deletions(-) 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 { +