Commit 24e9ab7f authored by zinkey's avatar zinkey Committed by 偏右

fixed umi/link umi/router

parent 81895705
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Icon, Divider } from 'antd'; import { Icon, Divider } from 'antd';
import { Link } from 'dva/router'; import Link from 'umi/link';
import Debounce from 'lodash-decorators/debounce'; import Debounce from 'lodash-decorators/debounce';
import styles from './index.less'; import styles from './index.less';
import RightContent from './RightContent'; import RightContent from './RightContent';
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Menu, Icon } from 'antd'; import { Menu, Icon } from 'antd';
import { Link } from 'dva/router'; import Link from 'umi/link';
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi/locale';
import pathToRegexp from 'path-to-regexp'; import pathToRegexp from 'path-to-regexp';
import { urlToList } from '../_utils/pathTools'; import { urlToList } from '../_utils/pathTools';
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Layout, Menu, Icon } from 'antd'; import { Layout, Menu, Icon } from 'antd';
import pathToRegexp from 'path-to-regexp'; import pathToRegexp from 'path-to-regexp';
import { Link } from 'dva/router'; import Link from 'umi/link';
import styles from './index.less'; import styles from './index.less';
import { urlToList } from '../_utils/pathTools'; import { urlToList } from '../_utils/pathTools';
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Layout } from 'antd'; import { Layout } from 'antd';
import pathToRegexp from 'path-to-regexp'; import pathToRegexp from 'path-to-regexp';
import { Link } from 'dva/router'; import Link from 'umi/link';
import styles from './index.less'; import styles from './index.less';
import BaseMenu, { getMenuMatches } from './BaseMenu'; import BaseMenu, { getMenuMatches } from './BaseMenu';
import { urlToList } from '../_utils/pathTools'; import { urlToList } from '../_utils/pathTools';
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { Link } from 'dva/router'; import Link from 'umi/link';
import RightContent from '../GlobalHeader/RightContent'; import RightContent from '../GlobalHeader/RightContent';
import BaseMenu from '../SiderMenu/BaseMenu'; import BaseMenu from '../SiderMenu/BaseMenu';
import styles from './index.less'; import styles from './index.less';
......
...@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react'; ...@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import { Layout, message } from 'antd'; import { Layout, message } from 'antd';
import Animate from 'rc-animate'; import Animate from 'rc-animate';
import { connect } from 'dva'; import { connect } from 'dva';
import { routerRedux } from 'dva/router'; import router from 'umi/router';
import GlobalHeader from '@/components/GlobalHeader'; import GlobalHeader from '@/components/GlobalHeader';
import TopNavHeader from '@/components/TopNavHeader'; import TopNavHeader from '@/components/TopNavHeader';
import styles from './Header.less'; import styles from './Header.less';
...@@ -44,15 +44,15 @@ class HeaderView extends PureComponent { ...@@ -44,15 +44,15 @@ class HeaderView extends PureComponent {
handleMenuClick = ({ key }) => { handleMenuClick = ({ key }) => {
const { dispatch } = this.props; const { dispatch } = this.props;
if (key === 'userCenter') { if (key === 'userCenter') {
dispatch(routerRedux.push('/account/center')); router.push('/account/center');
return; return;
} }
if (key === 'triggerError') { if (key === 'triggerError') {
dispatch(routerRedux.push('/exception/trigger')); router.push('/exception/trigger');
return; return;
} }
if (key === 'userinfo') { if (key === 'userinfo') {
dispatch(routerRedux.push('/account/settings/base')); router.push('/account/settings/base');
return; return;
} }
if (key === 'logout') { if (key === 'logout') {
......
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi/locale';
import { Link } from 'dva/router'; import Link from 'umi/link';
import PageHeader from '@/components/PageHeader'; import PageHeader from '@/components/PageHeader';
import GridContent from './GridContent'; import GridContent from './GridContent';
import styles from './PageHeaderLayout.less'; import styles from './PageHeaderLayout.less';
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { Link } from 'dva/router'; import Link from 'umi/link';
import { Icon } from 'antd'; import { Icon } from 'antd';
import GlobalFooter from '@/components/GlobalFooter'; import GlobalFooter from '@/components/GlobalFooter';
import styles from './UserLayout.less'; import styles from './UserLayout.less';
......
import React from 'react'; import React from 'react';
import { Link } from 'dva/router'; import Link from 'umi/link';
import Exception from '@/components/Exception'; import Exception from '@/components/Exception';
export default () => ( export default () => (
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Link, routerRedux } from 'dva/router'; import Link from 'umi/link';
import router from 'umi/router';
import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd'; import { Card, Row, Col, Icon, Avatar, Tag, Divider, Spin, Input } from 'antd';
import GridContent from '@/layouts/GridContent'; import GridContent from '@/layouts/GridContent';
import styles from './Center.less'; import styles from './Center.less';
...@@ -36,16 +37,16 @@ export default class Center extends PureComponent { ...@@ -36,16 +37,16 @@ export default class Center extends PureComponent {
} }
onTabChange = key => { onTabChange = key => {
const { dispatch, match } = this.props; const { match } = this.props;
switch (key) { switch (key) {
case 'articles': case 'articles':
dispatch(routerRedux.push(`${match.url}/articles`)); router.push(`${match.url}/articles`);
break; break;
case 'applications': case 'applications':
dispatch(routerRedux.push(`${match.url}/applications`)); router.push(`${match.url}/applications`);
break; break;
case 'projects': case 'projects':
dispatch(routerRedux.push(`${match.url}/projects`)); router.push(`${match.url}/projects`);
break; break;
default: default:
break; break;
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { routerRedux } from 'dva/router'; import router from 'umi/router';
import { FormattedMessage } from 'umi/locale'; import { FormattedMessage } from 'umi/locale';
import { Menu } from 'antd'; import { Menu } from 'antd';
import styles from './Info.less'; import styles from './Info.less';
...@@ -71,8 +71,7 @@ export default class Info extends Component { ...@@ -71,8 +71,7 @@ export default class Info extends Component {
}; };
selectKey = ({ key }) => { selectKey = ({ key }) => {
const { dispatch } = this.props; router.push(`/account/settings/${key}`);
dispatch(routerRedux.push(`/account/settings/${key}`));
this.setState({ this.setState({
selectKey: key, selectKey: key,
}); });
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import moment from 'moment'; import moment from 'moment';
import { connect } from 'dva'; import { connect } from 'dva';
import { Link } from 'dva/router'; import Link from 'umi/link';
import { Row, Col, Card, List, Avatar } from 'antd'; import { Row, Col, Card, List, Avatar } from 'antd';
import { Radar } from '@/components/Charts'; import { Radar } from '@/components/Charts';
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi/locale';
import { Link } from 'dva/router'; import Link from 'umi/link';
import Exception from '@/components/Exception'; import Exception from '@/components/Exception';
class Exception403 extends Component { class Exception403 extends Component {
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi/locale';
import { Link } from 'dva/router'; import Link from 'umi/link';
import Exception from '@/components/Exception'; import Exception from '@/components/Exception';
class Exception404 extends Component { class Exception404 extends Component {
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { formatMessage } from 'umi/locale'; import { formatMessage } from 'umi/locale';
import { Link } from 'dva/router'; import Link from 'umi/link';
import Exception from '@/components/Exception'; import Exception from '@/components/Exception';
class Exception500 extends Component { class Exception500 extends Component {
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Form, Input, Button, Select, Divider } from 'antd'; import { Form, Input, Button, Select, Divider } from 'antd';
import { routerRedux } from 'dva/router'; import router from 'umi/router';
import styles from './style.less'; import styles from './style.less';
const { Option } = Select; const { Option } = Select;
...@@ -30,7 +30,7 @@ export default class Step1 extends React.PureComponent { ...@@ -30,7 +30,7 @@ export default class Step1 extends React.PureComponent {
type: 'form/saveStepFormData', type: 'form/saveStepFormData',
payload: values, payload: values,
}); });
dispatch(routerRedux.push('/form/step-form/confirm')); router.push('/form/step-form/confirm');
} }
}); });
}; };
......
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Form, Input, Button, Alert, Divider } from 'antd'; import { Form, Input, Button, Alert, Divider } from 'antd';
import { routerRedux } from 'dva/router'; import router from 'umi/router';
import { digitUppercase } from '@/utils/utils'; import { digitUppercase } from '@/utils/utils';
import styles from './style.less'; import styles from './style.less';
...@@ -20,7 +20,7 @@ class Step2 extends React.PureComponent { ...@@ -20,7 +20,7 @@ class Step2 extends React.PureComponent {
const { form, data, dispatch, submitting } = this.props; const { form, data, dispatch, submitting } = this.props;
const { getFieldDecorator, validateFields } = form; const { getFieldDecorator, validateFields } = form;
const onPrev = () => { const onPrev = () => {
dispatch(routerRedux.push('/form/step-form/info')); router.push('/form/step-form/info');
}; };
const onValidateForm = e => { const onValidateForm = e => {
e.preventDefault(); e.preventDefault();
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Button, Row, Col } from 'antd'; import { Button, Row, Col } from 'antd';
import { routerRedux } from 'dva/router'; import router from 'umi/router';
import Result from '@/components/Result'; import Result from '@/components/Result';
import styles from './style.less'; import styles from './style.less';
...@@ -10,9 +10,9 @@ import styles from './style.less'; ...@@ -10,9 +10,9 @@ import styles from './style.less';
})) }))
export default class Step3 extends React.PureComponent { export default class Step3 extends React.PureComponent {
render() { render() {
const { dispatch, data } = this.props; const { data } = this.props;
const onFinish = () => { const onFinish = () => {
dispatch(routerRedux.push('/form/step-form/info')); router.push('/form/step-form/info');
}; };
const information = ( const information = (
<div className={styles.information}> <div className={styles.information}>
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { routerRedux } from 'dva/router'; import router from 'umi/router';
import { connect } from 'dva'; import { connect } from 'dva';
import { Input } from 'antd'; import { Input } from 'antd';
import PageHeaderLayout from '@/layouts/PageHeaderLayout'; import PageHeaderLayout from '@/layouts/PageHeaderLayout';
...@@ -7,16 +7,16 @@ import PageHeaderLayout from '@/layouts/PageHeaderLayout'; ...@@ -7,16 +7,16 @@ import PageHeaderLayout from '@/layouts/PageHeaderLayout';
@connect() @connect()
export default class SearchList extends Component { export default class SearchList extends Component {
handleTabChange = key => { handleTabChange = key => {
const { dispatch, match } = this.props; const { match } = this.props;
switch (key) { switch (key) {
case 'articles': case 'articles':
dispatch(routerRedux.push(`${match.url}/articles`)); router.push(`${match.url}/articles`);
break; break;
case 'applications': case 'applications':
dispatch(routerRedux.push(`${match.url}/applications`)); router.push(`${match.url}/applications`);
break; break;
case 'projects': case 'projects':
dispatch(routerRedux.push(`${match.url}/projects`)); router.push(`${match.url}/projects`);
break; break;
default: default:
break; break;
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { Link } from 'dva/router'; import Link from 'umi/link';
import { Checkbox, Alert, Icon } from 'antd'; import { Checkbox, Alert, Icon } from 'antd';
import Login from '@/components/Login'; import Login from '@/components/Login';
import styles from './Login.less'; import styles from './Login.less';
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { routerRedux, Link } from 'dva/router'; import Link from 'umi/link';
import router from 'umi/router';
import { Form, Input, Button, Select, Row, Col, Popover, Progress } from 'antd'; import { Form, Input, Button, Select, Row, Col, Popover, Progress } from 'antd';
import styles from './Register.less'; import styles from './Register.less';
...@@ -39,7 +40,7 @@ export default class Register extends Component { ...@@ -39,7 +40,7 @@ export default class Register extends Component {
const account = form.getFieldValue('mail'); const account = form.getFieldValue('mail');
if (register.status === 'ok') { if (register.status === 'ok') {
dispatch( dispatch(
routerRedux.push({ router.push({
pathname: '/user/register-result', pathname: '/user/register-result',
state: { state: {
account, account,
......
import React from 'react'; import React from 'react';
import { Button } from 'antd'; import { Button } from 'antd';
import { Link } from 'dva/router'; import Link from 'umi/link';
import Result from '@/components/Result'; import Result from '@/components/Result';
import styles from './RegisterResult.less'; import styles from './RegisterResult.less';
......
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