Commit d2e84dda authored by 周宏民's avatar 周宏民

pref: 演示功能入口 优化跳转错误时回调

parent 3eb93f8a
Pipeline #85158 waiting for manual action with stages
...@@ -296,6 +296,11 @@ const Demonstration = props => { ...@@ -296,6 +296,11 @@ const Demonstration = props => {
setLoading(false); setLoading(false);
}); });
}; };
const handError = err => {
setJumpLoading(false);
};
useEffect(() => { useEffect(() => {
const handleToggleIndustry = event => { const handleToggleIndustry = event => {
props.history && props.history.push(`/?client=${props.global.client}`); props.history && props.history.push(`/?client=${props.global.client}`);
...@@ -307,6 +312,12 @@ const Demonstration = props => { ...@@ -307,6 +312,12 @@ const Demonstration = props => {
window.share.event.removeListener('toggleIndustry', handleToggleIndustry); window.share.event.removeListener('toggleIndustry', handleToggleIndustry);
}; };
}, [props]); }, [props]);
useEffect(() => {
window.share.event.on('loginError', handError);
return () => {
window.share.event.removeListener('loginError', handError);
};
}, [jumpLoading]);
useEffect(() => { useEffect(() => {
getData(); getData();
window.addEventListener('resize', debounce(onResize, 300)); window.addEventListener('resize', debounce(onResize, 300));
......
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