Commit bbe7bf69 authored by 杨思琦's avatar 杨思琦

fix: 登出状态保存修复

parent 99495221
Pipeline #72470 passed with stages
...@@ -7,8 +7,7 @@ import { connect } from 'react-redux'; ...@@ -7,8 +7,7 @@ import { connect } from 'react-redux';
import Icon from '@ant-design/icons'; import Icon from '@ant-design/icons';
import { AvatarDropdown as Avatar, useIntl } from '@wisdom-utils/components'; import { AvatarDropdown as Avatar, useIntl } from '@wisdom-utils/components';
import HeaderSearch from '@wisdom-utils/components/lib/layout/components/HeaderSearch'; import HeaderSearch from '@wisdom-utils/components/lib/layout/components/HeaderSearch';
import { useHistory } from '@wisdom-utils/runtime'; import { useHistory, useAliveController } from '@wisdom-utils/runtime';
import order from '../../assets/basic/message.png'; import order from '../../assets/basic/message.png';
import notice from '../../assets/basic/notice.png'; import notice from '../../assets/basic/notice.png';
import search from '../../assets/basic/search.png'; import search from '../../assets/basic/search.png';
...@@ -60,7 +59,7 @@ const GlobalHeaderRight = props => { ...@@ -60,7 +59,7 @@ const GlobalHeaderRight = props => {
const history = useHistory(); const history = useHistory();
const { theme, layout } = props; const { theme, layout } = props;
let className = styles.right; let className = styles.right;
const { clear } = useAliveController();
if (theme === 'dark' && layout === 'top') { if (theme === 'dark' && layout === 'top') {
className = `${styles.right} ${styles.dark}`; className = `${styles.right} ${styles.dark}`;
} }
...@@ -174,6 +173,11 @@ const GlobalHeaderRight = props => { ...@@ -174,6 +173,11 @@ const GlobalHeaderRight = props => {
) )
} }
const logout = () => {
clear();
props.logout();
}
const renderTopMenu = () => { const renderTopMenu = () => {
if(!props.global || !props.global.topMenu) return null; if(!props.global || !props.global.topMenu) return null;
const topMenus = props.global.topMenu.split(',') || []; const topMenus = props.global.topMenu.split(',') || [];
...@@ -210,7 +214,7 @@ const GlobalHeaderRight = props => { ...@@ -210,7 +214,7 @@ const GlobalHeaderRight = props => {
return ( return (
<div className={className}> <div className={className}>
{renderTopMenu()} {renderTopMenu()}
<Avatar menu config={props.global} updateCurrentIndex={props.updateCurrentIndex} updateConfig={props.updateConfig} logout={props.logout} /> <Avatar menu config={props.global} updateCurrentIndex={props.updateCurrentIndex} updateConfig={props.updateConfig} logout={logout} />
</div> </div>
); );
}; };
......
...@@ -23,7 +23,6 @@ import { waterMark } from '../utils/mark'; ...@@ -23,7 +23,6 @@ import { waterMark } from '../utils/mark';
import layoutStyles from './BasicLayout.less'; import layoutStyles from './BasicLayout.less';
import SecurityLayout from './SecurityLayout'; import SecurityLayout from './SecurityLayout';
import Site from './Site'; import Site from './Site';
import { initSaveMicroApps } from '../micro';
const { params } = helpers; const { params } = helpers;
......
...@@ -246,7 +246,7 @@ export const initMicroApps = (url) => { ...@@ -246,7 +246,7 @@ export const initMicroApps = (url) => {
if(window?.qiankunIsCache){ if(window?.qiankunIsCache){
microStore.on("event:dropCache", (() => { microStore.on("event:dropCache", (() => {
micorManager.map((micro) => { micorManager.map((micro) => {
micro.unmount ?? micro.unmount(); micro.unmount && micro.unmount();
}) })
micorManager = []; micorManager = [];
})); }));
......
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