Commit 9534bd37 authored by 周宏民's avatar 周宏民

fix: 修改云平台登录刷新的bug

parent 922c788c
Pipeline #89905 failed with stages
......@@ -42,7 +42,11 @@ const proxy = require('../../../../config/proxy');
const keywordStorage = new Storage(`__global_search_keywords__micro_${window.location.hostname}`);
const recentVisitedStorage = new Storage(`__global_recent_visited__micro_${window.location.hostname}`);
const recentProductStorage = new Storage(`__global__recent_product__micro_${window.location.hostname}`);
const currentProduct = `__global__recent_productIndex__micro_${window.location.hostname}_${sessionStorage.getItem('client') || params.getParams('client') || 'city'}`;
const currentProduct = `__global__recent_productIndex__micro_${window.location.hostname}_${sessionStorage.getItem(
'client',
) ||
params.getParams('client') ||
'city'}`;
sessionStorage.setItem(currentProduct, 0);
Cookies.set('loginMode', Cookies.get('loginMode') || 'pdw');
export const initialState = fromJS({
......@@ -88,7 +92,9 @@ const appReducer = (state = initialState, action) => {
window.arcgisAssetsPath = `${window.location.origin}/${pkg.name.toLocaleLowerCase()}/assets`;
window.__INITIAL_STATE__.mdi = 'SDI';
window.__INITIAL_STATE__.menu = 'banner-left';
window.globalConfig = AppConfig(window.__INITIAL_STATE__);
const temp = AppConfig(window.__INITIAL_STATE__)
temp.displayMode = window.__INITIAL_STATE__?.displayMode||''
window.globalConfig = temp;
// eslint-disable-next-line no-undef
......
......@@ -455,7 +455,12 @@ const Demonstration = props => {
};
}, []);
useEffect(() => {
getData();
if (props.global?.userInfo) {
getData();
} else {
timer.current && clearInterval(timer.current);
timer.current = null;
}
window.addEventListener('resize', debounce(onResize, 300));
onResize();
......
......@@ -157,7 +157,7 @@ const Integration = props => {
.catch(err => {
notification.error({ message: '提示', duration: 3, description: '集成站点配置错误' });
});
}, [props.global.token]);
}, []);
return (
<div className={styles.bootPage}>
......
......@@ -225,6 +225,15 @@ class Login {
if (loginMode && loginMode === 'iotWechat') ddCode = null;
// self.qrcodeLogin(self.globalConfig.qrcodeData.code);
if (token) {
if (loginMode === 'qywx') {
// 微信登录刷新退出登录
Cookies.set('token', '', {
path: '/',
});
const client = this?.global?.client || sessionStorage.getItem('client') || null;
window.location.href = `${WX_REDIRECT_URI}?client=${client}`;
return;
}
self.getToweb(token, noTokenSite);
// eslint-disable-next-line no-empty
} else if (ddCode && loginMode === 'dingding') {
......@@ -279,7 +288,14 @@ class Login {
self.isSignIn = true;
self.globalConfig.userInfo = window?.globalConfig?.transformUserInfo?.(response.data) ?? {};
self.updateConfig && self.updateConfig(self.globalConfig);
self.getUserInfoAndConfig(null, true);
let flag = true;
const loginMode = Cookies.get('loginMode');
if (loginMode === 'qywx') {
flag = false;
}
// flag 为true 时,不会进引导页或集成登录
self.getUserInfoAndConfig(null, flag);
} else {
self.logout && self.logout();
if (params.getParams('token')) {
......@@ -345,8 +361,8 @@ class Login {
}
});
}
// eslint-disable-next-line prettier/prettier
if (!flag && this.isSignIn && this.globalConfig.userInfo.Industries.length && this.globalConfig.userInfo.Industries.length > 1 && !window.qiankunStarted) {
// 根据配置信息里的 displayMode 判断显示哪个引导页
if (!flag && this.isSignIn && this.globalConfig.displayMode === 'demonstration' && !window.qiankunStarted) {
this.createContext(this);
this.updateConfig && this.updateConfig(this.globalConfig);
this.events && this.events.emit('loginIndustry');
......
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