Commit 63159031 authored by 邓晓峰's avatar 邓晓峰

fix: 修复登陆信息错乱

parent dea88155
Pipeline #40697 passed with stages
in 4 minutes 17 seconds
......@@ -2,7 +2,7 @@ import { fromJS } from 'immutable';
import Cookies from 'js-cookie';
import AppConfig from 'kit_global_config';
import { Storeage as Store } from 'kit_utils';
import { store } from 'microser-data';
import { store, event } from 'microser-data';
import { Storage } from '@wisdom-utils/utils';
import pkg from '../../../../package.json';
import defaultSetting from '../../../../config/defaultSetting';
......@@ -139,6 +139,7 @@ const appReducer = (state = initialState, action) => {
Cookies.set('city', Cookies.get('city') || window.globalConfig.client);
window.globalConfig = config;
return state.merge({
globalConfig: config,
menu: generMenu || [],
......@@ -229,6 +230,7 @@ const appReducer = (state = initialState, action) => {
microMounted: action.data,
});
case LOGINOUT:
event.emit('event: application-logout', action.data);
return state.merge({
complexConfig: action.data.complexConfig,
currentMenuIndex: action.data.currentMenuIndex,
......
......@@ -11,7 +11,7 @@ export const initGlobalConfig = (loader, store, render) => {
// eslint-disable-next-line no-debugger
// eslint-disable-next-line no-undef
createStoreage.remove(`__PANDA_STORE__${location.hostname}`);
window.globalConfig = {};
let config = createStoreage.get('globalConfig') || {};
store.dispatch(actionCreators.updateComplexConfig({}));
if (!getToken() || config.token == null) {
......@@ -74,6 +74,7 @@ export const initGlobalConfig = (loader, store, render) => {
Object.assign({}, data, {
token: '',
access_token: '',
userInfo: null
}),
),
);
......
......@@ -426,7 +426,7 @@ const BasicLayout = props => {
}
const handleUpdateCurrentIndex = index => {
debugger
setSelectIndex(-1)
props.updateCurrentIndex(index);
window.share && window.share.event.emit('trigger:updateMenuIndex', index);
......
......@@ -34,7 +34,6 @@ const MICRO_STATUS = {
export const initMicroApps = (loader, store) => {
/* eslint-disable */
const config = createStoreage.get('globalConfig');
const application = config && config.products || [];
let products = [];
......@@ -54,7 +53,7 @@ export const initMicroApps = (loader, store) => {
process.env.NODE_ENV !== 'production' ?
micorConfig.dev :
products;
console.log("reateStoreage.get('globalConfig')", createStoreage.get('globalConfig'))
registerMicroApps(
entrys.map(item => {
item.loader = loader;
......
......@@ -227,7 +227,7 @@ class Login {
if(self.globalConfig.hasOwnProperty('webConfig')) {
self.globalConfig = {
...self.globalConfig,
// ...self.globalConfig,
...self.globalConfig.webConfig.basicConfig,
...self.globalConfig.webConfig.optionalConfig
}
......@@ -690,6 +690,7 @@ class Login {
/* eslint-disable */
let _industrySite = null;
if (industry) {
const userInfo =
self.globalConfig.userInfo &&
self.globalConfig.userInfo.Groups &&
......@@ -741,7 +742,7 @@ class Login {
self.globalConfig.userInfo = Object.assign(
{},
response,
self.globalConfig.userInfo,
// self.globalConfig.userInfo,
);
if(response.hasOwnProperty('data')) {
self.globalConfig.userInfo = {
......
......@@ -6,4 +6,9 @@ store.on('event:route', (url) => {
window.share && window.share.event && window.share.event.on('event:logs', params => {
delete params.site;
appService.pvLogs(params);
})
});
// store.on('event:logout', () => {
// window.globalConfig = {};
// })
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