diff --git a/config/config.js b/config/config.js index a6300dccc66260e8748755f88fd045c720ec9777..9fed99723c9fb785136783c8c095b168a9f30944 100644 --- a/config/config.js +++ b/config/config.js @@ -3,6 +3,7 @@ // https://umijs.org/config/ const path = require('path'); +const pageRoutes = require('../src/pages/_routes'); export default { // add for transfer to umi @@ -13,6 +14,9 @@ export default { 'umi-plugin-routes', { exclude: [/\.test\.js/], + update(routes) { + return [...pageRoutes, ...routes]; + }, }, ], ], diff --git a/src/common/menu.js b/src/common/menu.js index abcbe9eb559c4e513c862357ddd28f5a6d06c7e4..6c78a950fbc55b15f3867f399482d49bd51e74f0 100644 --- a/src/common/menu.js +++ b/src/common/menu.js @@ -194,6 +194,7 @@ import { isUrl } from '../utils/utils'; +// TODO: authority const menuData = [ { name: 'dashboard', @@ -211,6 +212,7 @@ const menuData = [ { name: '工作台', path: 'Workplace', + // hideInBreadcrumb: true, // hideInMenu: true, }, ], @@ -226,11 +228,11 @@ const menuData = [ }, { name: '分步表单', - path: 'StepForm/Step1', + path: 'StepForm', }, { name: '高级表单', - authority: 'admin', + // authority: 'admin', path: 'AdvancedForm', }, ], @@ -246,7 +248,7 @@ const menuData = [ }, { name: '标准列表', - path: 'BasicList', + path: 'basicList', }, { name: '卡片列表', @@ -279,11 +281,11 @@ const menuData = [ children: [ { name: '基础详情页', - path: 'BasicProfile', + path: 'Basic', }, { name: '高级详情页', - path: 'AdvancedProfile', + path: 'Advanced', authority: 'admin', }, ], @@ -299,7 +301,7 @@ const menuData = [ }, { name: '失败', - path: 'Error', + path: 'Fail', }, ], }, @@ -347,6 +349,21 @@ const menuData = [ }, ], }, + { + name: '个人页', + icon: 'user', + path: 'Account', + children: [ + { + name: '个人中心', + path: 'Center', + }, + { + name: '个人设置', + path: 'Settings', + }, + ], + }, ]; function formatter(data, parentPath = '/', parentAuthority) { diff --git a/src/models/form.js b/src/models/form.js index 64a1d49794b9b059564eadf7fce0bb9dbde5a8a3..d849f802a25bc162490e8e74fb909ef03de8f267 100644 --- a/src/models/form.js +++ b/src/models/form.js @@ -25,7 +25,7 @@ export default { type: 'saveStepFormData', payload, }); - yield put(routerRedux.push('/form/step-form/result')); + yield put(routerRedux.push('/Forms/StepForm/Step3')); }, *submitAdvancedForm({ payload }, { call }) { yield call(fakeSubmitForm, payload); diff --git a/src/pages/Forms/StepForm/Step1.js b/src/pages/Forms/StepForm/Step1.js index 5082c1a31c428b8dc88975687e36fb57d685df82..0f5723969b273781c38e491f01dc4334662c8b06 100644 --- a/src/pages/Forms/StepForm/Step1.js +++ b/src/pages/Forms/StepForm/Step1.js @@ -27,7 +27,7 @@ class Step1 extends React.PureComponent { type: 'form/saveStepFormData', payload: values, }); - dispatch(routerRedux.push('/form/step-form/confirm')); + dispatch(routerRedux.push('/Forms/StepForm/Step2')); } }); }; diff --git a/src/pages/Forms/StepForm/Step2.js b/src/pages/Forms/StepForm/Step2.js index 9b142007a8aaef7e6c2af22b2bc06d882dca8772..9daa3fe0cd1195b075170d63badd79ce0bb854d4 100644 --- a/src/pages/Forms/StepForm/Step2.js +++ b/src/pages/Forms/StepForm/Step2.js @@ -20,7 +20,7 @@ class Step2 extends React.PureComponent { const { form, data, dispatch, submitting } = this.props; const { getFieldDecorator, validateFields } = form; const onPrev = () => { - dispatch(routerRedux.push('/form/step-form')); + dispatch(routerRedux.push('/Forms/StepForm')); }; const onValidateForm = e => { e.preventDefault(); diff --git a/src/pages/Forms/StepForm/Step3.js b/src/pages/Forms/StepForm/Step3.js index 9a8d6d46cc92a7aa57881a1c9f83511c35b24560..eb8afeac16bd76818ccea57281d8e03b8f45fb19 100644 --- a/src/pages/Forms/StepForm/Step3.js +++ b/src/pages/Forms/StepForm/Step3.js @@ -9,7 +9,7 @@ class Step3 extends React.PureComponent { render() { const { dispatch, data } = this.props; const onFinish = () => { - dispatch(routerRedux.push('/form/step-form')); + dispatch(routerRedux.push('/Forms/StepForm')); }; const information = (