Commit 6d619771 authored by ddcat1115's avatar ddcat1115

adjust category

parent 257e294c
......@@ -113,6 +113,17 @@ const menuData = [{
name: '注册结果',
path: 'register-result',
}],
}, {
name: '个人页',
icon: 'user',
path: 'user-profile',
children: [{
name: '个人中心',
path: 'user-center',
}, {
name: '个人设置',
path: 'userinfo',
}],
}];
function formatter(data, parentPath = '/', parentAuthority) {
......
......@@ -151,9 +151,6 @@ export const getRouterData = (app) => {
'/exception/trigger': {
component: dynamicWrapper(app, ['error'], () => import('../routes/Exception/triggerException')),
},
'/user-center': {
component: dynamicWrapper(app, ['list', 'user', 'project'], () => import('../routes/UserCenter')),
},
'/user': {
component: dynamicWrapper(app, [], () => import('../layouts/UserLayout')),
},
......@@ -166,20 +163,23 @@ export const getRouterData = (app) => {
'/user/register-result': {
component: dynamicWrapper(app, [], () => import('../routes/User/RegisterResult')),
},
'/userinfo': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/Userinfo/Info')),
'/user-profile/user-center': {
component: dynamicWrapper(app, ['list', 'user', 'project'], () => import('../routes/UserProfile/UserCenter')),
},
'/user-profile/userinfo': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/Info')),
},
'/userinfo/base': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/Userinfo/BaseView')),
'/user-profile/userinfo/base': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/BaseView')),
},
'/userinfo/safe': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/Userinfo/SafeView')),
'/user-profile/userinfo/safe': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/SafeView')),
},
'/userinfo/account': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/Userinfo/AccountView')),
'/user-profile/userinfo/account': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/AccountView')),
},
'/userinfo/message': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/Userinfo/MessageView')),
'/user-profile/userinfo/message': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/MessageView')),
},
// '/user/:id': {
// component: dynamicWrapper(app, [], () => import('../routes/User/SomeComponent')),
......
......@@ -128,7 +128,7 @@ class BasicLayout extends React.PureComponent {
}
handleMenuClick = ({ key }) => {
if (key === 'userCenter') {
this.props.dispatch(routerRedux.push('/user-center'));
this.props.dispatch(routerRedux.push('/user-profile/user-center'));
return;
}
if (key === 'triggerError') {
......@@ -136,7 +136,7 @@ class BasicLayout extends React.PureComponent {
return;
}
if (key === 'userinfo') {
this.props.dispatch(routerRedux.push('/userinfo/base'));
this.props.dispatch(routerRedux.push('/user-profile/userinfo/base'));
return;
}
if (key === 'logout') {
......
......@@ -5,12 +5,12 @@ import moment from 'moment';
import numeral from 'numeral';
import { List, Card, Row, Col, Icon, Dropdown,
Menu, Avatar, Tag, Divider, Tooltip, Spin, Input } from 'antd';
import AvatarList from '../components/AvatarList';
import { formatWan } from '../utils/utils';
import AvatarList from '../../components/AvatarList';
import { formatWan } from '../../utils/utils';
import styles from './UserCenter.less';
import stylesArticles from './List/Articles.less';
import stylesApplications from './List/Applications.less';
import stylesProjects from './List/Projects.less';
import stylesArticles from '../List/Articles.less';
import stylesApplications from '../List/Applications.less';
import stylesProjects from '../List/Projects.less';
@connect(({ list, loading, user, project }) => ({
list,
......
@import '~antd/lib/style/themes/default.less';
@import "../utils/utils.less";
@import "../../utils/utils.less";
.avatarHolder {
text-align: center;
......
......@@ -3,7 +3,7 @@ import { connect } from 'dva';
import { Route, routerRedux, Switch, Redirect } from 'dva/router';
import { Menu } from 'antd';
import styles from './Info.less';
import { getRoutes } from '../../utils/utils';
import { getRoutes } from '../../../utils/utils';
const { Item } = Menu;
......@@ -36,7 +36,7 @@ export default class Info extends Component {
return menuMap[this.state.selectKey];
};
selectKey = ({ key }) => {
this.props.dispatch(routerRedux.push(`/userinfo/${key}`));
this.props.dispatch(routerRedux.push(`/user-profile/userinfo/${key}`));
this.setState({
selectKey: key,
});
......@@ -70,7 +70,7 @@ export default class Info extends Component {
exact={item.exact}
/>
))}
<Redirect exact from="/userinfo" to="/userinfo/base" />
<Redirect exact from="/user-profile/userinfo" to="/user-profile/userinfo/base" />
<Redirect to="/exception/404" />
</Switch>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment