import React, { Component } from 'react' import { Row, Col, Icon , Input, Button, Select} from 'antd' import axios from 'axios'; class Profile extends Component { constructor(props) { super(props) this.state = { usernameEdit: false, emailEdit: false, secureEdit: false, roleEdit: false } this.getUserInfo(101) } handleEdit = (key, val) =>{ var s = {}; s[key] = val ; this.setState(s) } getUserInfo = (id) => { axios.get('/user/find', { id: id }).then((res) =>{ console.log(res) }) } render() { let ButtonGroup = Button.Group; let userNameEditHtml, emailEditHtml,secureEditHtml, roleEditHtml; const Option = Select.Option; if(this.state.usernameEdit === false){ userNameEditHtml =
xiaoming   {this.handleEdit( 'usernameEdit', true)}}>修改
}else{ userNameEditHtml =
} if(this.state.emailEdit === false){ emailEditHtml =
abc@qq.com   {this.handleEdit( 'emailEdit', true)}} >修改
}else{ emailEditHtml =
} if(this.state.roleEdit === true){ roleEditHtml =
管理员   {this.handleEdit( 'roleEdit', true)}} >修改
}else{ roleEditHtml = } if(this.state.secureEdit === false){ secureEditHtml = }else{ secureEditHtml =
} return
用户名 {userNameEditHtml} Email {emailEditHtml} 角色 {roleEditHtml} 安全 {secureEditHtml}
} } export default Profile