feat: 用户管理的面包屑

This commit is contained in:
wenbo.dong 2017-08-28 20:18:01 +08:00
parent 70384ab19a
commit bfc3d69ec3
2 changed files with 7 additions and 7 deletions

View File

@ -22,9 +22,7 @@ export default class BreadcrumbNavigation extends Component {
breadcrumb: PropTypes.array
}
render () {
console.log(this.props.breadcrumb);
const getItem = this.props.breadcrumb.map((item, index) => {
console.log(item);
if (item.href) {
return (<Breadcrumb.Item key={index}><Link to={item.href}>{item.name}</Link></Breadcrumb.Item>);
} else {

View File

@ -65,12 +65,18 @@ class Profile extends Component {
getUserInfo = (id) => {
var _this = this;
const { curUid } = this.props;
axios.get('/api/user/find?id=' + id).then((res) => {
_this.setState({
userinfo: res.data.data,
_userinfo: res.data.data
})
})
if (curUid === +id) {
this.props.setBreadcrumb([{name: res.data.data.username}]);
} else {
this.props.setBreadcrumb([{name: '管理: ' + res.data.data.username}]);
}
});
}
updateUserinfo = (name) =>{
@ -149,10 +155,6 @@ class Profile extends Component {
}
async componentWillMount() {
this.props.setBreadcrumb([{name: '用户资料'}]);
}
render() {
let ButtonGroup = Button.Group;
let userNameEditHtml, emailEditHtml, secureEditHtml, roleEditHtml;