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

fix: 认证修改

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