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

fixed umi/link umi/router

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