Commit 6d619771 authored by ddcat1115's avatar ddcat1115

adjust category

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