Commit f87d7371 authored by ddcat1115's avatar ddcat1115 Committed by jim

better url #1072

parent ed0b743c
...@@ -116,13 +116,13 @@ const menuData = [{ ...@@ -116,13 +116,13 @@ const menuData = [{
}, { }, {
name: '个人页', name: '个人页',
icon: 'user', icon: 'user',
path: 'user-profile', path: 'account',
children: [{ children: [{
name: '个人中心', name: '个人中心',
path: 'user-center', path: 'center',
}, { }, {
name: '个人设置', name: '个人设置',
path: 'userinfo/base', path: 'settings',
}], }],
}]; }];
......
...@@ -163,23 +163,23 @@ export const getRouterData = (app) => { ...@@ -163,23 +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')),
}, },
'/user-profile/user-center': { '/account/center': {
component: dynamicWrapper(app, ['list', 'user', 'project'], () => import('../routes/UserProfile/UserCenter')), component: dynamicWrapper(app, ['list', 'user', 'project'], () => import('../routes/Account/Center')),
}, },
'/user-profile/userinfo': { '/account/settings': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/Info')), component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/Info')),
}, },
'/user-profile/userinfo/base': { '/account/settings/base': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/BaseView')), component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/BaseView')),
}, },
'/user-profile/userinfo/safe': { '/account/settings/security': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/SafeView')), component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/SecurityView')),
}, },
'/user-profile/userinfo/account': { '/account/settings/binding': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/AccountView')), component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/BindingView')),
}, },
'/user-profile/userinfo/message': { '/account/settings/notification': {
component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/MessageView')), component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/NotificationView')),
}, },
// '/user/:id': { // '/user/:id': {
// component: dynamicWrapper(app, [], () => import('../routes/User/SomeComponent')), // component: dynamicWrapper(app, [], () => import('../routes/User/SomeComponent')),
......
...@@ -20,8 +20,8 @@ import { ...@@ -20,8 +20,8 @@ import {
} from 'antd'; } 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 stylesProjects from '../List/Projects.less'; import stylesProjects from '../List/Projects.less';
import styles from './Center.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 GridContent from '../../layouts/GridContent'; import GridContent from '../../layouts/GridContent';
...@@ -34,7 +34,7 @@ import GridContent from '../../layouts/GridContent'; ...@@ -34,7 +34,7 @@ import GridContent from '../../layouts/GridContent';
project, project,
projectLoading: loading.effects['project/fetchNotice'], projectLoading: loading.effects['project/fetchNotice'],
})) }))
export default class UserCenter extends PureComponent { export default class Center extends PureComponent {
state = { state = {
key: 'article', key: 'article',
newTags: [], newTags: [],
......
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { Icon, List } from 'antd'; import { Icon, List } from 'antd';
export default class AccountView extends Component { export default class BindingView extends Component {
getData = () => { getData = () => {
return [ return [
{ {
......
...@@ -10,9 +10,9 @@ const { Item } = Menu; ...@@ -10,9 +10,9 @@ const { Item } = Menu;
const menuMap = { const menuMap = {
base: '基本设置', base: '基本设置',
safe: '安全设置', security: '安全设置',
account: '账号绑定', binding: '账号绑定',
message: '新消息通知', notification: '新消息通知',
}; };
@connect(({ user }) => ({ @connect(({ user }) => ({
...@@ -45,7 +45,7 @@ export default class Info extends Component { ...@@ -45,7 +45,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(`/user-profile/userinfo/${key}`)); this.props.dispatch(routerRedux.push(`/account/settings/${key}`));
this.setState({ this.setState({
selectKey: key, selectKey: key,
}); });
...@@ -101,7 +101,11 @@ export default class Info extends Component { ...@@ -101,7 +101,11 @@ export default class Info extends Component {
exact={item.exact} exact={item.exact}
/> />
))} ))}
<Redirect exact from="/userinfo" to="/userinfo/base" /> <Redirect
exact
from="/account/settings"
to="/account/settings/base"
/>
<Redirect to="/exception/404" /> <Redirect to="/exception/404" />
</Switch> </Switch>
</div> </div>
......
...@@ -3,7 +3,7 @@ import { Switch, List } from 'antd'; ...@@ -3,7 +3,7 @@ import { Switch, List } from 'antd';
const Action = <Switch checkedChildren="" unCheckedChildren="" defaultChecked />; const Action = <Switch checkedChildren="" unCheckedChildren="" defaultChecked />;
export default class MessageView extends Component { export default class NotificationView extends Component {
getData = () => { getData = () => {
return [ return [
{ {
......
...@@ -7,7 +7,7 @@ const passwordStrength = { ...@@ -7,7 +7,7 @@ const passwordStrength = {
weak: <font className="weak"></font>, weak: <font className="weak"></font>,
}; };
export default class SafeView extends Component { export default class SecurityView extends Component {
getData = () => { getData = () => {
return [ return [
{ {
......
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