From f87d7371bb0402e6f715f8face5a18a7c675ecd1 Mon Sep 17 00:00:00 2001 From: ddcat1115 Date: Mon, 12 Mar 2018 23:39:20 +0800 Subject: [PATCH] better url #1072 --- src/common/menu.js | 6 ++--- src/common/router.js | 24 +++++++++---------- .../UserCenter.js => Account/Center.js} | 4 ++-- .../UserCenter.less => Account/Center.less} | 0 .../Userinfo => Account/Settings}/BaseView.js | 0 .../Settings}/BaseView.less | 0 .../Settings/BindingView.js} | 2 +- .../Settings}/GeographicView.js | 0 .../Settings}/GeographicView.less | 0 .../Userinfo => Account/Settings}/Info.js | 14 +++++++---- .../Userinfo => Account/Settings}/Info.less | 0 .../Settings/NotificationView.js} | 2 +- .../Settings}/PhoneView.js | 0 .../Settings}/PhoneView.less | 0 .../Settings/SecurityView.js} | 2 +- 15 files changed, 29 insertions(+), 25 deletions(-) rename src/routes/{UserProfile/UserCenter.js => Account/Center.js} (99%) rename src/routes/{UserProfile/UserCenter.less => Account/Center.less} (100%) rename src/routes/{UserProfile/Userinfo => Account/Settings}/BaseView.js (100%) rename src/routes/{UserProfile/Userinfo => Account/Settings}/BaseView.less (100%) rename src/routes/{UserProfile/Userinfo/AccountView.js => Account/Settings/BindingView.js} (95%) rename src/routes/{UserProfile/Userinfo => Account/Settings}/GeographicView.js (100%) rename src/routes/{UserProfile/Userinfo => Account/Settings}/GeographicView.less (100%) rename src/routes/{UserProfile/Userinfo => Account/Settings}/Info.js (89%) rename src/routes/{UserProfile/Userinfo => Account/Settings}/Info.less (100%) rename src/routes/{UserProfile/Userinfo/MessageView.js => Account/Settings/NotificationView.js} (94%) rename src/routes/{UserProfile/Userinfo => Account/Settings}/PhoneView.js (100%) rename src/routes/{UserProfile/Userinfo => Account/Settings}/PhoneView.less (100%) rename src/routes/{UserProfile/Userinfo/SafeView.js => Account/Settings/SecurityView.js} (96%) diff --git a/src/common/menu.js b/src/common/menu.js index d71c86e2..e85a612d 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 9c3df8b1..fe822611 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 ada929cb..e35d9b6b 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 ff533d32..cae4d084 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 529b1047..e52c6ee1 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 d2f3f986..98f1af90 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 332e033a..0bc7cf90 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 [ { -- GitLab