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

fix: 认证修改

parent bb9ceb66
Pipeline #84605 passed with stages
......@@ -316,32 +316,36 @@ const Layout = props => {
clear();
props.logout();
}
store.on('event:unauthorized', () => {
if(props.global.security === "1") {
store.off('event:unauthorized');
const key = `open${Date.now()}`;
if(notify) return false;
notify = true;
notification.open({
description: '登录认证过期,即将跳转到登录页',
duration: null,
btn: (
<Button
className={classNames(`${prefixCls}-btn`, `${prefixCls}-btn-primary`)}
type="primary"
onClick={() => {
notification.close(key);
setTimeout(() => {
notify = null;
clear();
props.logout();
})
}}>确认
</Button>
),
key,
closeIcon: <></>,
} else {
store.on('event:unauthorized', () => {
store.off('event:unauthorized');
const key = `open${Date.now()}`;
if(notify) return false;
notify = true;
notification.open({
description: '登录认证过期,即将跳转到登录页',
duration: null,
btn: (
<Button
className={classNames(`${prefixCls}-btn`, `${prefixCls}-btn-primary`)}
type="primary"
onClick={() => {
notification.close(key);
setTimeout(() => {
notify = null;
clear();
props.logout();
})
}}>确认
</Button>
),
key,
closeIcon: <></>,
});
});
});
}
return () => {
store.off('event:unauthorized');
};
......
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