Commit da4bd116 authored by 愚道's avatar 愚道

add account settings

parent 931e27fb
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
routes: [ routes: [
{ {
path: '/', path: '/',
component: './layouts/index', component: './layouts/LoadingPage',
routes: [ routes: [
// dashboard // dashboard
{ path: '/', redirect: '/dashboard/analysis' }, { path: '/', redirect: '/dashboard/analysis' },
...@@ -77,31 +77,33 @@ export default { ...@@ -77,31 +77,33 @@ export default {
{ path: '/exception/404', component: './Exception/404' }, { path: '/exception/404', component: './Exception/404' },
{ path: '/exception/500', component: './Exception/500' }, { path: '/exception/500', component: './Exception/500' },
// acount // account
{ {
path: '/acount/center', path: '/account/center',
component: './Account/Center/Center', component: './Account/Center/Center',
routes: [ routes: [
{ path: '/acount/center', redirect: '/acount/center/articles' }, { path: '/account/center', redirect: '/account/center/articles' },
{ path: '/acount/center/articles', component: './Account/Center/Articles' }, { path: '/account/center/articles', component: './Account/Center/Articles' },
{ path: '/acount/center/applications', component: './Account/Center/Applications' }, { path: '/account/center/applications', component: './Account/Center/Applications' },
{ path: '/acount/center/projects', component: './Account/Center/Projects' }, { path: '/account/center/projects', component: './Account/Center/Projects' },
], ],
}, },
{ {
path: '/acount/settings', path: '/account/settings',
component: './Account/Settings/Info', component: './Account/Settings/Info',
routes: [ routes: [
{ path: '/acount/settings', redirect: '/acount/settings/base' }, { path: '/account/settings', redirect: '/account/settings/base' },
{ path: '/acount/center/base', component: './Account/Settings/BaseView' }, { path: '/account/settings/base', component: './Account/Settings/BaseView' },
{ path: '/acount/center/security', component: './Account/Settings/SecurityView' }, { path: '/account/settings/security', component: './Account/Settings/SecurityView' },
{ path: '/acount/center/binding', component: './Account/Settings/BindingView' }, { path: '/account/settings/binding', component: './Account/Settings/BindingView' },
{ {
path: '/acount/center/notification', path: '/account/settings/notification',
component: './Account/Settings/NotificationView', component: './Account/Settings/NotificationView',
}, },
], ],
}, },
// user
], ],
}, },
], ],
......
...@@ -352,7 +352,7 @@ const menuData = [ ...@@ -352,7 +352,7 @@ const menuData = [
{ {
name: '个人页', name: '个人页',
icon: 'user', icon: 'user',
path: 'acount', path: 'account',
children: [ children: [
{ {
name: '个人中心', name: '个人中心',
......
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { Form, Input, Upload, Select, Button } from 'antd'; import { Form, Input, Upload, Select, Button } from 'antd';
import { connect } from 'dva';
import styles from './BaseView.less'; import styles from './BaseView.less';
import GeographicView from './GeographicView'; import GeographicView from './GeographicView';
import PhoneView from './PhoneView'; import PhoneView from './PhoneView';
...@@ -44,6 +45,9 @@ const validatorPhone = (rule, value, callback) => { ...@@ -44,6 +45,9 @@ const validatorPhone = (rule, value, callback) => {
callback(); callback();
}; };
@connect(({ user }) => ({
currentUser: user.currentUser,
}))
@Form.create() @Form.create()
export default class BaseView extends Component { export default class BaseView extends Component {
componentDidMount() { componentDidMount() {
......
import React from 'react';
export default props => <div style={{ height: '100%' }} {...props} />;
...@@ -3,12 +3,14 @@ import { Spin } from 'antd'; ...@@ -3,12 +3,14 @@ import { Spin } from 'antd';
import { connect } from 'dva'; import { connect } from 'dva';
import { enquireScreen, unenquireScreen } from 'enquire-js'; import { enquireScreen, unenquireScreen } from 'enquire-js';
import BasicLayout from './BasicLayout'; import BasicLayout from './BasicLayout';
import { getMenuData } from '../common/menu'; import { getMenuData } from '../../common/menu';
import { getRouterData } from '../../common/router';
/** /**
* 根据菜单取得重定向地址. * 根据菜单取得重定向地址.
*/ */
const MenuData = getMenuData(); const MenuData = getMenuData();
const routerData = getRouterData({});
const getRedirectData = () => { const getRedirectData = () => {
const redirectData = []; const redirectData = [];
const getRedirect = item => { const getRedirect = item => {
...@@ -90,6 +92,7 @@ class LoadingPage extends PureComponent { ...@@ -90,6 +92,7 @@ class LoadingPage extends PureComponent {
<BasicLayout <BasicLayout
isMobile={isMobile} isMobile={isMobile}
menuData={MenuData} menuData={MenuData}
routerData={routerData}
redirectData={redirectData} redirectData={redirectData}
{...this.props} {...this.props}
/> />
......
import React from 'react';
import { getRouterData } from 'common/router';
import { getMenuData } from 'common/menu';
import BasecLayout from './BasicLayout';
import BlankLayout from './BlankLayout';
// TODO routerData menuData etc...
const openPages = ['/User', '/User/Login', '/User/Register', '/User/RegisterResult'];
export default props => {
const { children, location } = props;
const routerData = getRouterData({});
const menuData = getMenuData({});
let { pathname } = location;
pathname = pathname.startsWith('/') ? pathname : `/${pathname}`;
if (openPages && openPages.includes(pathname)) {
return <BlankLayout>{children}</BlankLayout>;
}
return (
<BasecLayout routerData={routerData} menuData={menuData} location={location}>
{children}
</BasecLayout>
);
};
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