Commit d36aa9bb authored by 邓晓峰's avatar 邓晓峰

fix: 修复首页路由匹配

parent 7278f663
Pipeline #42236 passed with stages
in 1 minute 50 seconds
...@@ -3,10 +3,10 @@ import { message } from 'antd'; ...@@ -3,10 +3,10 @@ import { message } from 'antd';
import _, { words } from 'lodash'; import _, { words } from 'lodash';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { withRouter } from 'react-router'; import { withRouter } from 'react-router';
import { loadMicroApp } from 'qiankun';
import { useIntl } from '@/locales/localeExports'; import { useIntl } from '@/locales/localeExports';
import Icon from '@ant-design/icons'; import Icon from '@ant-design/icons';
import { setDefaultMountApp } from 'qiankun'
import { actionCreators } from '../../containers/App/store'; import { actionCreators } from '../../containers/App/store';
import HeaderSearch from '../HeaderSearch'; import HeaderSearch from '../HeaderSearch';
import Avatar from './AvatarDropdown'; import Avatar from './AvatarDropdown';
...@@ -126,6 +126,9 @@ const GlobalHeaderRight = props => { ...@@ -126,6 +126,9 @@ const GlobalHeaderRight = props => {
? props.global.get('homepage') ? props.global.get('homepage')
: props.global.get('homepage.url'); : props.global.get('homepage.url');
window.share.event.emit('goHome', `/${url}`); window.share.event.emit('goHome', `/${url}`);
// setDefaultMountApp()
// 1、window.globalConfig product
// 2. 拿到当前product
url ? ( url ? (
window.share.event.emit('listenerMointer', { window.share.event.emit('listenerMointer', {
label: '首页', label: '首页',
......
...@@ -352,13 +352,19 @@ const BasicLayout = props => { ...@@ -352,13 +352,19 @@ const BasicLayout = props => {
// setChildrenRoutes(currentChildrenRoute) // setChildrenRoutes(currentChildrenRoute)
window.share.event.on('goHome', url => { window.share.event.on('goHome', url => {
setChildrenRoutes([ setChildrenRoutes([
{ {
icon: <HomeIcon/>, icon: <HomeIcon/>,
path: url, path: url,
name: '首页' name: '首页'
} }
]) ]);
setTabActiveKey(url);
window.history.pushState(null, '', `/civbase${url}`);
}); });
/** /**
* web4全屏退出,切换三级菜单高亮 * web4全屏退出,切换三级菜单高亮
...@@ -435,6 +441,7 @@ const BasicLayout = props => { ...@@ -435,6 +441,7 @@ const BasicLayout = props => {
} }
const handleSelectMenuItem = (item) => { const handleSelectMenuItem = (item) => {
debugger
setTabActiveKey(item); setTabActiveKey(item);
if(item.indexOf('web_console') === -1) { if(item.indexOf('web_console') === -1) {
window.history.pushState(null, '', `/civbase${item}`); window.history.pushState(null, '', `/civbase${item}`);
......
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