|
@@ -7,7 +7,7 @@ import {
|
|
|
Sider
|
|
|
} = Layout;
|
|
|
const SubMenu = Menu.SubMenu;
|
|
|
-
|
|
|
+ const axios = require('axios');
|
|
|
class LeftMenu extends Component {
|
|
|
state = {
|
|
|
collapsed: false,
|
|
@@ -17,7 +17,29 @@ class LeftMenu extends Component {
|
|
|
this.setState({ collapsed });
|
|
|
}
|
|
|
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() {
|
|
|
|
|
@@ -47,18 +69,19 @@ class LeftMenu extends Component {
|
|
|
key="sub6"
|
|
|
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>
|
|
|
- <Menu.Item key="5">Alex</Menu.Item>
|
|
|
</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
|
|
|
key="sub2"
|
|
|
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>
|
|
|
</SubMenu>
|
|
|
<Menu.Item key="9">
|