Skip to content

Commit

Permalink
上传标签uploadkey修改,首页添加创建banner
Browse files Browse the repository at this point in the history
  • Loading branch information
dsaco committed Oct 16, 2017
1 parent 6c8cb06 commit 159e7e9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
26 changes: 25 additions & 1 deletion src/scripts/components/Common/PlayMainHeader/PlayMainHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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(
Expand Down Expand Up @@ -58,7 +70,7 @@ class PlayMainHeader extends Component {
<a href="#" className="m-menu__link m-menu__toggle">
<i className="m-menu__link-icon flaticon-add"></i>
<span className="m-menu__link-text">
Actions
操作
</span>
<i className="m-menu__hor-arrow la la-angle-down"></i>
<i className="m-menu__ver-arrow la la-angle-right"></i>
Expand Down Expand Up @@ -95,6 +107,18 @@ class PlayMainHeader extends Component {
</span>
</a>
</li>
<li className="m-menu__item " data-redirect="true" aria-haspopup="true">
<a className="m-menu__link " onClick={this.addDraft}>
<i className="m-menu__link-icon icon-directions"></i>
<span className="m-menu__link-title">
<span className="m-menu__link-wrap">
<span className="m-menu__link-text">
创建banner
</span>
</span>
</span>
</a>
</li>
<li className="m-menu__item m-menu__item--submenu" data-menu-submenu-toggle="hover" aria-haspopup="true">
<a href="#" className="m-menu__link m-menu__toggle">
<i className="m-menu__link-icon flaticon-business"></i>
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/components/EditTag/EditTag.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default class EditTag extends Component{
}
_onDropImage(files) {
let file = files[0];
let uploadKey = `tag/image/${this.state.id}.${Math.random().toString().substring(2,12)}`
let uploadKey = `tag/image/${this.state.id}_${Math.random().toString().substring(2,12)}`
Request
.get(`/api/uptoken?key=${uploadKey}`)
.end((err,res) => {
Expand All @@ -118,7 +118,7 @@ export default class EditTag extends Component{
}
_onDropCover(files) {
let file = files[0];
let uploadKey = `tag/cover/${this.state.id}.${Math.random().toString().substring(2,12)}`
let uploadKey = `tag/cover/${this.state.id}_${Math.random().toString().substring(2,12)}`
Request
.get(`/api/uptoken?key=${uploadKey}`)
.end((err,res) => {
Expand Down

0 comments on commit 159e7e9

Please sign in to comment.