[fix-code-format] Fix umi Router Import Error
Umi3 deprecated router, switch to umi history for the router feature.
import React, { Component } from 'react';
import { Layout, message } from 'antd';
import Animate from 'rc-animate';
-import router from 'umi/router';
-import { connect, formatMessage } from 'umi';
+import { connect, formatMessage, history } from 'umi';
import GlobalHeader from '@/components/GlobalHeader';
import TopNavHeader from '@/components/TopNavHeader';
import styles from './Header.less';
@@ -56,15 +55,15 @@ class HeaderView extends Component {
handleMenuClick = ({ key }) => {
const { dispatch } = this.props;
if (key === 'userCenter') {
- router.push('/account/center');
+ history.push('/account/center');
return;
}
if (key === 'triggerError') {
- router.push('/exception/trigger');
+ history.push('/exception/trigger');
return;
}
if (key === 'userinfo') {
- router.push('/account/settings/base');
+ history.push('/account/settings/base');
return;
}
if (key === 'logout') {
