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

fix: 修改跳转指定功能不成功的bug

parent 8c7b1e84
Pipeline #93697 passed with stages
...@@ -41,7 +41,6 @@ const IntegrationNew = props => { ...@@ -41,7 +41,6 @@ const IntegrationNew = props => {
const timer3 = useRef(null); const timer3 = useRef(null);
const timer4 = useRef(null); const timer4 = useRef(null);
const clientRef = useRef(props.global.client); const clientRef = useRef(props.global.client);
const clientInfo = useRef({}); // 跳转子站信息
const progressRef2 = useRef(0); const progressRef2 = useRef(0);
const loadingTime = integratedConfig?.loadingTime || 5; const loadingTime = integratedConfig?.loadingTime || 5;
const [loginAction, setAction] = useState(() => new LoginAction(props)); const [loginAction, setAction] = useState(() => new LoginAction(props));
...@@ -193,7 +192,8 @@ const IntegrationNew = props => { ...@@ -193,7 +192,8 @@ const IntegrationNew = props => {
}); });
return; return;
} }
clientInfo.current = item; // 用全局存跳转信息,跳转过程页面会刷新
window.clientInfo = item;
if (window.qiankunIsCache) { if (window.qiankunIsCache) {
store.set('event:dropCache'); store.set('event:dropCache');
} }
...@@ -223,7 +223,7 @@ const IntegrationNew = props => { ...@@ -223,7 +223,7 @@ const IntegrationNew = props => {
jumpProgressStart(); jumpProgressStart();
startTiming(loadingTime); startTiming(loadingTime);
window.jumpLoadingProgress = 99; window.jumpLoadingProgress = 99;
loginA && loginA.getUserInfoAndConfig('', true); loginA && loginA.getUserInfoAndConfig('', true, item.type);
}; };
const onLink = (item, loginA) => { const onLink = (item, loginA) => {
const token = props.global?.token || Cookies.get('token'); const token = props.global?.token || Cookies.get('token');
...@@ -345,8 +345,9 @@ const IntegrationNew = props => { ...@@ -345,8 +345,9 @@ const IntegrationNew = props => {
setJumpLoading(false); setJumpLoading(false);
jumpProgressEnd(); jumpProgressEnd();
window.jumpLoadingProgress = 0; window.jumpLoadingProgress = 0;
if (clientInfo.current?.url && clientInfo.current.subType === '内链') { if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
goToPath(clientInfo.current?.url); goToPath(window.clientInfo?.url);
window.clientInfo = null;
} else { } else {
props.history.push(`/?client=${clientRef.current || props.global.client}`); props.history.push(`/?client=${clientRef.current || props.global.client}`);
props.updateCurrentIndex && props.updateCurrentIndex(0); props.updateCurrentIndex && props.updateCurrentIndex(0);
...@@ -358,11 +359,11 @@ const IntegrationNew = props => { ...@@ -358,11 +359,11 @@ const IntegrationNew = props => {
setJumpLoading(false); setJumpLoading(false);
jumpProgressEnd(); jumpProgressEnd();
}; };
loginAction.events.on('loginSuccess', handleToggleIndustry); loginAction.events.on('toggleIndustry', handleToggleIndustry);
loginAction.events.on('loginError', handleError); loginAction.events.on('loginError', handleError);
return () => { return () => {
loginAction && loginAction.events && loginAction.events.removeListener('loginSuccess', handleToggleIndustry); loginAction && loginAction.events && loginAction.events.removeListener('toggleIndustry', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError); loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
}; };
}, [loginAction.events, props]); }, [loginAction.events, props]);
......
...@@ -213,7 +213,8 @@ const IntegrationQinzhou = props => { ...@@ -213,7 +213,8 @@ const IntegrationQinzhou = props => {
sessionStorage.removeItem(currentProduct); sessionStorage.removeItem(currentProduct);
const currentProductNew = `__global__recent_productIndex__micro_${window.location.hostname}_${cli || 'city'}`; const currentProductNew = `__global__recent_productIndex__micro_${window.location.hostname}_${cli || 'city'}`;
sessionStorage.setItem(currentProductNew, 0); sessionStorage.setItem(currentProductNew, 0);
clientInfo.current = item; // 用全局存跳转信息,跳转过程页面会刷新
window.clientInfo = item;
clientRef.current = cli; clientRef.current = cli;
const config = props.global; const config = props.global;
config.uiwidgets = []; config.uiwidgets = [];
...@@ -227,7 +228,7 @@ const IntegrationQinzhou = props => { ...@@ -227,7 +228,7 @@ const IntegrationQinzhou = props => {
jumpProgressStart(); jumpProgressStart();
startTiming(loadingTime); startTiming(loadingTime);
window.jumpLoadingProgress = 99; window.jumpLoadingProgress = 99;
loginA && loginA.getUserInfoAndConfig('', true); loginA && loginA.getUserInfoAndConfig('', true, item.type);
}; };
const onLink = (item, loginA) => { const onLink = (item, loginA) => {
if (!item) return; if (!item) return;
...@@ -281,8 +282,9 @@ const IntegrationQinzhou = props => { ...@@ -281,8 +282,9 @@ const IntegrationQinzhou = props => {
setJumpLoading(false); setJumpLoading(false);
jumpProgressEnd(); jumpProgressEnd();
window.jumpLoadingProgress = 0; window.jumpLoadingProgress = 0;
if (clientInfo.current?.url && clientInfo.current.subType === '内链') { if (window.clientInfo?.url && window.clientInfo.subType === '内链') {
goToPath(clientInfo.current?.url); goToPath(window.clientInfo?.url);
window.clientInfo = null;
} else { } else {
props.history.push(`/?client=${clientRef.current || props.global.client}`); props.history.push(`/?client=${clientRef.current || props.global.client}`);
props.updateCurrentIndex && props.updateCurrentIndex(0); props.updateCurrentIndex && props.updateCurrentIndex(0);
...@@ -294,11 +296,11 @@ const IntegrationQinzhou = props => { ...@@ -294,11 +296,11 @@ const IntegrationQinzhou = props => {
jumpProgressEnd(); jumpProgressEnd();
}; };
loginAction.events.on('loginSuccess', handleToggleIndustry); loginAction.events.on('toggleIndustry', handleToggleIndustry);
loginAction.events.on('loginError', handleError); loginAction.events.on('loginError', handleError);
return () => { return () => {
loginAction && loginAction.events && loginAction.events.removeListener('loginSuccess', handleToggleIndustry); loginAction && loginAction.events && loginAction.events.removeListener('toggleIndustry', handleToggleIndustry);
loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError); loginAction && loginAction.events && loginAction.events.removeListener('loginError', handleError);
}; };
}, [loginAction.events, props]); }, [loginAction.events, props]);
......
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