diff --git a/src/common/menu.js b/src/common/menu.js index d71c86e20bbc5a2f2298c0a9b757dc4159261711..e85a612d998463dd80fc550a34f7fc97c94d9feb 100644 --- a/src/common/menu.js +++ b/src/common/menu.js @@ -116,13 +116,13 @@ const menuData = [{ }, { name: '个人页', icon: 'user', - path: 'user-profile', + path: 'account', children: [{ name: '个人中心', - path: 'user-center', + path: 'center', }, { name: '个人设置', - path: 'userinfo/base', + path: 'settings', }], }]; diff --git a/src/common/router.js b/src/common/router.js index 9c3df8b105327e42427ff557dde5e845a0d6d6c6..fe8226119f2fa9f7abee24d027e03ee731acae07 100644 --- a/src/common/router.js +++ b/src/common/router.js @@ -163,23 +163,23 @@ export const getRouterData = (app) => { '/user/register-result': { component: dynamicWrapper(app, [], () => import('../routes/User/RegisterResult')), }, - '/user-profile/user-center': { - component: dynamicWrapper(app, ['list', 'user', 'project'], () => import('../routes/UserProfile/UserCenter')), + '/account/center': { + component: dynamicWrapper(app, ['list', 'user', 'project'], () => import('../routes/Account/Center')), }, - '/user-profile/userinfo': { - component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/Info')), + '/account/settings': { + component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/Info')), }, - '/user-profile/userinfo/base': { - component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/BaseView')), + '/account/settings/base': { + component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/BaseView')), }, - '/user-profile/userinfo/safe': { - component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/SafeView')), + '/account/settings/security': { + component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/SecurityView')), }, - '/user-profile/userinfo/account': { - component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/AccountView')), + '/account/settings/binding': { + component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/BindingView')), }, - '/user-profile/userinfo/message': { - component: dynamicWrapper(app, ['geographic'], () => import('../routes/UserProfile/Userinfo/MessageView')), + '/account/settings/notification': { + component: dynamicWrapper(app, ['geographic'], () => import('../routes/Account/Settings/NotificationView')), }, // '/user/:id': { // component: dynamicWrapper(app, [], () => import('../routes/User/SomeComponent')), diff --git a/src/routes/UserProfile/UserCenter.js b/src/routes/Account/Center.js similarity index 99% rename from src/routes/UserProfile/UserCenter.js rename to src/routes/Account/Center.js index ada929cbde311a62ccf11fb628a8d3fd8f58ff2c..e35d9b6b6800170cf3dbff1bbbb88d2a58e91029 100644 --- a/src/routes/UserProfile/UserCenter.js +++ b/src/routes/Account/Center.js @@ -20,8 +20,8 @@ import { } from 'antd'; import AvatarList from '../../components/AvatarList'; import { formatWan } from '../../utils/utils'; -import styles from './UserCenter.less'; import stylesProjects from '../List/Projects.less'; +import styles from './Center.less'; import stylesArticles from '../List/Articles.less'; import stylesApplications from '../List/Applications.less'; import GridContent from '../../layouts/GridContent'; @@ -34,7 +34,7 @@ import GridContent from '../../layouts/GridContent'; project, projectLoading: loading.effects['project/fetchNotice'], })) -export default class UserCenter extends PureComponent { +export default class Center extends PureComponent { state = { key: 'article', newTags: [], diff --git a/src/routes/UserProfile/UserCenter.less b/src/routes/Account/Center.less similarity index 100% rename from src/routes/UserProfile/UserCenter.less rename to src/routes/Account/Center.less diff --git a/src/routes/UserProfile/Userinfo/BaseView.js b/src/routes/Account/Settings/BaseView.js similarity index 100% rename from src/routes/UserProfile/Userinfo/BaseView.js rename to src/routes/Account/Settings/BaseView.js diff --git a/src/routes/UserProfile/Userinfo/BaseView.less b/src/routes/Account/Settings/BaseView.less similarity index 100% rename from src/routes/UserProfile/Userinfo/BaseView.less rename to src/routes/Account/Settings/BaseView.less diff --git a/src/routes/UserProfile/Userinfo/AccountView.js b/src/routes/Account/Settings/BindingView.js similarity index 95% rename from src/routes/UserProfile/Userinfo/AccountView.js rename to src/routes/Account/Settings/BindingView.js index ff533d322448f12a1faa64db1e0b9690eb355f3c..cae4d08479426726902de7ec51aa33257e20850e 100644 --- a/src/routes/UserProfile/Userinfo/AccountView.js +++ b/src/routes/Account/Settings/BindingView.js @@ -1,7 +1,7 @@ import React, { Component, Fragment } from 'react'; import { Icon, List } from 'antd'; -export default class AccountView extends Component { +export default class BindingView extends Component { getData = () => { return [ { diff --git a/src/routes/UserProfile/Userinfo/GeographicView.js b/src/routes/Account/Settings/GeographicView.js similarity index 100% rename from src/routes/UserProfile/Userinfo/GeographicView.js rename to src/routes/Account/Settings/GeographicView.js diff --git a/src/routes/UserProfile/Userinfo/GeographicView.less b/src/routes/Account/Settings/GeographicView.less similarity index 100% rename from src/routes/UserProfile/Userinfo/GeographicView.less rename to src/routes/Account/Settings/GeographicView.less diff --git a/src/routes/UserProfile/Userinfo/Info.js b/src/routes/Account/Settings/Info.js similarity index 89% rename from src/routes/UserProfile/Userinfo/Info.js rename to src/routes/Account/Settings/Info.js index 529b1047b56108a0d9b97711bfc79eb786113ac1..e52c6ee1c04fa9a492057f0172c52cbb3fab8c86 100644 --- a/src/routes/UserProfile/Userinfo/Info.js +++ b/src/routes/Account/Settings/Info.js @@ -10,9 +10,9 @@ const { Item } = Menu; const menuMap = { base: '基本设置', - safe: '安全设置', - account: '账号绑定', - message: '新消息通知', + security: '安全设置', + binding: '账号绑定', + notification: '新消息通知', }; @connect(({ user }) => ({ @@ -45,7 +45,7 @@ export default class Info extends Component { return menuMap[this.state.selectKey]; }; selectKey = ({ key }) => { - this.props.dispatch(routerRedux.push(`/user-profile/userinfo/${key}`)); + this.props.dispatch(routerRedux.push(`/account/settings/${key}`)); this.setState({ selectKey: key, }); @@ -101,7 +101,11 @@ export default class Info extends Component { exact={item.exact} /> ))} - + diff --git a/src/routes/UserProfile/Userinfo/Info.less b/src/routes/Account/Settings/Info.less similarity index 100% rename from src/routes/UserProfile/Userinfo/Info.less rename to src/routes/Account/Settings/Info.less diff --git a/src/routes/UserProfile/Userinfo/MessageView.js b/src/routes/Account/Settings/NotificationView.js similarity index 94% rename from src/routes/UserProfile/Userinfo/MessageView.js rename to src/routes/Account/Settings/NotificationView.js index d2f3f986dde7ae0afaba378b85e87ce631467187..98f1af9034b16712d426e554aa2b690522520823 100644 --- a/src/routes/UserProfile/Userinfo/MessageView.js +++ b/src/routes/Account/Settings/NotificationView.js @@ -3,7 +3,7 @@ import { Switch, List } from 'antd'; const Action = ; -export default class MessageView extends Component { +export default class NotificationView extends Component { getData = () => { return [ { diff --git a/src/routes/UserProfile/Userinfo/PhoneView.js b/src/routes/Account/Settings/PhoneView.js similarity index 100% rename from src/routes/UserProfile/Userinfo/PhoneView.js rename to src/routes/Account/Settings/PhoneView.js diff --git a/src/routes/UserProfile/Userinfo/PhoneView.less b/src/routes/Account/Settings/PhoneView.less similarity index 100% rename from src/routes/UserProfile/Userinfo/PhoneView.less rename to src/routes/Account/Settings/PhoneView.less diff --git a/src/routes/UserProfile/Userinfo/SafeView.js b/src/routes/Account/Settings/SecurityView.js similarity index 96% rename from src/routes/UserProfile/Userinfo/SafeView.js rename to src/routes/Account/Settings/SecurityView.js index 332e033a573ada40147e001463f70715ee9bcbe5..0bc7cf901ccc3c12d70b66127410aa90b4f529bd 100644 --- a/src/routes/UserProfile/Userinfo/SafeView.js +++ b/src/routes/Account/Settings/SecurityView.js @@ -7,7 +7,7 @@ const passwordStrength = { weak: , }; -export default class SafeView extends Component { +export default class SecurityView extends Component { getData = () => { return [ {