todo: userConfig

This commit is contained in:
2020-01-06 02:38:55 +08:00
parent 48077eb75f
commit 6617b483cf
8 changed files with 48 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ const { Option } = Select;
const App = () => (
<SiderConfig ></SiderConfig>
<SiderConfig></SiderConfig>
);

View File

@@ -19,7 +19,8 @@ class Login extends React.Component {
form.append("pwd", pwd);
axios.post("/api/login", form).then(value => {
console.log(value);
ReactDom.render(<SiderConfig></SiderConfig>, document.getElementById('root'))
console.log("Cookies are ", document.cookie)
ReactDom.render(<SiderConfig userName={user}></SiderConfig>, document.getElementById('root'))
return
});

View File

@@ -1,6 +1,7 @@
import React from 'react';
import { TreeSelect } from 'antd';
import axios from 'axios';
const { TreeNode } = TreeSelect;
@@ -17,6 +18,13 @@ class NamespaceSelect extends React.Component {
};
onDropdownVisibleChange = (open) => {
if(open) {
var resp = axios.post("/api/user/config")
console.log(resp)
}
}
render() {
@@ -31,6 +39,7 @@ class NamespaceSelect extends React.Component {
multiple={false}
treeDefaultExpandAll
onChange={this.onChange}
onDropdownVisibleChange={this.onDropdownVisibleChange}
>
<TreeNode value="parent %#@" title="parent 112312312321312313132131313131231" key="0-1">
<TreeNode value="parent 1%#@0" title="parent 112312312321312313132131313131231-0" key="0-1-1">

View File

@@ -43,12 +43,14 @@ class SiderConfig extends React.Component {
</Menu>
</Sider>
<Layout>
<Header style={{ background: '#fff', padding: 0, }}>
<Header itemType="flex" style={{ justifyContent: "flex-end", background: '#fff', padding: 0, }}>
<Row type="flex" justify="end">
<Col span={4}> <Text style={{fontSize: 16, color: "#f37b1d"}}>用户:</Text> <Text style={{fontSize: 16}}></Text> </Col>
<Col span={4}><Button type="primary" style={{ width: '100px', }}>退出</Button></Col>
<Col>
<Text style={{ alignSelf: "flex-end", fontSize: 16, color: "#f37b1d" }}>用户:</Text>
<Text style={{ fontSize: 16 }}>{this.props.userName}</Text>
<Button type="primary" style={{ margin: "0px 10px 0 20px", width: '100px', }}>退出</Button>
</Col>
</Row>
</Header >
@@ -57,7 +59,7 @@ class SiderConfig extends React.Component {
<Breadcrumb.Item>User</Breadcrumb.Item>
<Breadcrumb.Item>Bill</Breadcrumb.Item>
</Breadcrumb>
<TextArea style={{ minHeight: '90vh' }}>
<TextArea style={{ minHeight: '92%' }}>
</TextArea>
</Content>