Commit da4bd116 authored by 愚道's avatar 愚道

add account settings

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