mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
feat: 用户管理的面包屑
This commit is contained in:
parent
70384ab19a
commit
bfc3d69ec3
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user