Commit 923065c1 authored by 崔佳豪's avatar 崔佳豪

fix: toggleIndustry 事件清除

parent e9057518
......@@ -56,6 +56,7 @@ const renderIndustries = (config, callback) =>
}
});
let loginAction = null;
const BootPage = props => {
const [loadding, setLoadding] = useState(false);
......@@ -70,24 +71,25 @@ const BootPage = props => {
event.preventDefault();
setLoadding(true);
const config = props.global;
const loginAction = new LoginAction(props);
// const loginAction = new LoginAction(props);
config.uiwidgets = [];
config.widgets = [];
config.allWidgets = [];
props.instance && props.instance.updateConfig(config);
// props.instance && props.instance.getUserInfoAndConfig('', true, type);
loginAction.getUserInfoAndConfig('', true, type);
loginAction && loginAction.getUserInfoAndConfig('', true, type);
// eslint-disable-next-line no-shadow
loginAction.events.on('toggleIndustry', event => {
setLoadding(false);
// props.history.push(`/?client=${props.global.client}`);
initMicroApps();
// 加载首页
history.push(props.global.homepage ?? `/?client=${props.global.client}`);
window.share.event.emit('triggerMicro', props.global);
props.updateCurrentIndex(0);
// window.location.reload();
});
// loginAction.events.on('toggleIndustry', event => {
// setLoadding(false);
// // props.history.push(`/?client=${props.global.client}`);
// debugger
// initMicroApps();
// // 加载首页
// history.push(props.global.homepage ?? `/?client=${props.global.client}`);
// window.share.event.emit('triggerMicro', props.global);
// props.updateCurrentIndex(0);
// // window.location.reload();
// });
}, []);
useEffect(() => {
// eslint-disable-next-line no-use-before-define
......@@ -102,8 +104,20 @@ const BootPage = props => {
};
useEffect(() => {
window.addEventListener('resize', handleResize);
loginAction = new LoginAction(props);
loginAction.events.on('toggleIndustry', async (event) => {
setLoadding(false);
props.history.push(`/?client=${props.global.client}`);
initMicroApps();
// 加载首页
// history.push(props.global.homepage ?? `/?client=${props.global.client}`);
window.share.event.emit('triggerMicro', props.global);
props.updateCurrentIndex(0);
// window.location.reload();
});
return () => {
window.removeEventListener('resize', handleResize);
loginAction.events.removeAllListeners('toggleIndustry');
};
});
const renderIndustr = useMemo(
......
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