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

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

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