@@ -7,11 +7,12 @@ import { Token, User } from './Ballcat';
77
88export type NotifyProps = { id : string ; content : string ; title : string } ;
99let logoutModal : any ;
10+ let cleanCache : any = ( ) => { } ;
1011
1112const logoutHandler = ( ) => {
12- Modal . destroyAll ( ) ;
1313 User . clean ( ) ;
1414 logoutModal = undefined ;
15+ cleanCache ( ) ;
1516 const { pathname } = history . location ;
1617 history . replace ( `/user/login?redirect=${ pathname } ` ) ;
1718} ;
@@ -24,13 +25,16 @@ const readNotice = (id: string) => {
2425} ;
2526
2627const Notify = {
28+ setCleanCache : ( clean : any ) => {
29+ cleanCache = clean ;
30+ } ,
2731 preview : ( props : NotifyProps ) => {
2832 Notify . notice ( { ...props , id : '' } ) ;
2933 } ,
3034 notice : ( { id, content, title } : NotifyProps ) => {
3135 Modal . info ( {
3236 title,
33- content : < div dangerouslySetInnerHTML = { { __html : content } } > </ div > ,
37+ content : < div dangerouslySetInnerHTML = { { __html : content } } / >,
3438 width : 800 ,
3539 icon : (
3640 < NotificationOutlined
@@ -56,6 +60,8 @@ const Notify = {
5660 return ;
5761 }
5862 Token . clean ( ) ;
63+ Modal . destroyAll ( ) ;
64+
5965 logoutModal = Modal . info ( {
6066 title : I18n . text ( 'notify.logout.title' ) ,
6167 content : I18n . text ( 'notify.logout.content' ) ,
@@ -64,6 +70,7 @@ const Notify = {
6470 okText : I18n . text ( 'notify.logout.okText' ) ,
6571 onOk : ( ) => logoutHandler ( ) ,
6672 onCancel : ( ) => logoutHandler ( ) ,
73+ zIndex : 99999999 ,
6774 } ) ;
6875 } ,
6976} ;
0 commit comments