|
@@ -7,7 +7,7 @@ import {
|
|
Sider
|
|
Sider
|
|
} = Layout;
|
|
} = Layout;
|
|
const SubMenu = Menu.SubMenu;
|
|
const SubMenu = Menu.SubMenu;
|
|
-
|
|
|
|
|
|
+ const axios = require('axios');
|
|
class LeftMenu extends Component {
|
|
class LeftMenu extends Component {
|
|
state = {
|
|
state = {
|
|
collapsed: false,
|
|
collapsed: false,
|
|
@@ -17,7 +17,29 @@ class LeftMenu extends Component {
|
|
this.setState({ collapsed });
|
|
this.setState({ collapsed });
|
|
}
|
|
}
|
|
onChange = ()=>{
|
|
onChange = ()=>{
|
|
- console.log(this);
|
|
|
|
|
|
+ axios.post(`http://127.0.0.1:2000/api/staffs`,{
|
|
|
|
+ "title": "Футлка",
|
|
|
|
+ "description": "Продаю футболку Адидас",
|
|
|
|
+ "staff": "Одежда",
|
|
|
|
+ "price": 100,
|
|
|
|
+ "state": "0",
|
|
|
|
+ "img": "",
|
|
|
|
+ "userId": "1",
|
|
|
|
+ "categoryId": "1"
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ .then(function (response) {
|
|
|
|
+ // handle success
|
|
|
|
+ console.log(response);
|
|
|
|
+ }).catch((err)=>
|
|
|
|
+ console.log(err))
|
|
|
|
+}
|
|
|
|
+ onChange1 = ()=>{
|
|
|
|
+ axios.get('http://127.0.0.1:2000/api/staffs')
|
|
|
|
+ .then(function (response) {
|
|
|
|
+ // handle success
|
|
|
|
+ console.log(response.data);
|
|
|
|
+ })
|
|
}
|
|
}
|
|
render() {
|
|
render() {
|
|
|
|
|
|
@@ -47,18 +69,19 @@ class LeftMenu extends Component {
|
|
key="sub6"
|
|
key="sub6"
|
|
title={<span><Icon type="shopping" /><span>Женское белье</span></span>}
|
|
title={<span><Icon type="shopping" /><span>Женское белье</span></span>}
|
|
>
|
|
>
|
|
- <Menu.Item key="4"><button onClick={this.onChange}>2332
|
|
|
|
|
|
+ <Menu.Item key="3"><button onClick={this.onChange}>Post
|
|
|
|
+ </button></Menu.Item>
|
|
|
|
+ <Menu.Item key="4"><button onClick={this.onChange1}>Get
|
|
</button></Menu.Item>
|
|
</button></Menu.Item>
|
|
- <Menu.Item key="5">Alex</Menu.Item>
|
|
|
|
</SubMenu>
|
|
</SubMenu>
|
|
- <Menu.Item key="4">Bill</Menu.Item>
|
|
|
|
- <Menu.Item key="5">Alex</Menu.Item>
|
|
|
|
|
|
+ <Menu.Item key="5">Bill</Menu.Item>
|
|
|
|
+ <Menu.Item key="6">Alex</Menu.Item>
|
|
</SubMenu>
|
|
</SubMenu>
|
|
<SubMenu
|
|
<SubMenu
|
|
key="sub2"
|
|
key="sub2"
|
|
title={<span><Icon type="team" /><span>Team</span></span>}
|
|
title={<span><Icon type="team" /><span>Team</span></span>}
|
|
>
|
|
>
|
|
- <Menu.Item key="6">Team 1</Menu.Item>
|
|
|
|
|
|
+ <Menu.Item key="7">Team 1</Menu.Item>
|
|
<Menu.Item key="8">Team 2</Menu.Item>
|
|
<Menu.Item key="8">Team 2</Menu.Item>
|
|
</SubMenu>
|
|
</SubMenu>
|
|
<Menu.Item key="9">
|
|
<Menu.Item key="9">
|