|
|
@@ -2,6 +2,7 @@ import { clearSessionToken } from '@/access'; |
|
|
import { setRemoteMenu } from '@/services/session'; |
|
|
import { setRemoteMenu } from '@/services/session'; |
|
|
import { logout } from '@/services/system/auth'; |
|
|
import { logout } from '@/services/system/auth'; |
|
|
import { ClientInfo } from '@/types'; |
|
|
import { ClientInfo } from '@/types'; |
|
|
|
|
|
import { sleep } from '@/utils/promise'; |
|
|
import SessionStorage from '@/utils/sessionStorage'; |
|
|
import SessionStorage from '@/utils/sessionStorage'; |
|
|
import { gotoLoginPage, oauthLogout } from '@/utils/ui'; |
|
|
import { gotoLoginPage, oauthLogout } from '@/utils/ui'; |
|
|
import { LogoutOutlined, UserOutlined } from '@ant-design/icons'; |
|
|
import { LogoutOutlined, UserOutlined } from '@ant-design/icons'; |
|
|
@@ -63,16 +64,15 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => { |
|
|
*/ |
|
|
*/ |
|
|
const loginOut = async () => { |
|
|
const loginOut = async () => { |
|
|
oauthLogout('http://172.20.32.197:31209/oauth/logout'); |
|
|
oauthLogout('http://172.20.32.197:31209/oauth/logout'); |
|
|
await logout(); |
|
|
|
|
|
|
|
|
// 至少 1 秒后跳转,希望子系统能完成注销 |
|
|
|
|
|
await Promise.all([logout(), sleep(1000)]); |
|
|
clearSessionToken(); |
|
|
clearSessionToken(); |
|
|
setRemoteMenu(null); |
|
|
setRemoteMenu(null); |
|
|
gotoLoginPage(); |
|
|
gotoLoginPage(); |
|
|
const clientInfo: ClientInfo = SessionStorage.getItem(SessionStorage.clientInfoKey, true); |
|
|
const clientInfo: ClientInfo = SessionStorage.getItem(SessionStorage.clientInfoKey, true); |
|
|
if (clientInfo) { |
|
|
if (clientInfo) { |
|
|
const { logoutUri } = clientInfo; |
|
|
const { logoutUri } = clientInfo; |
|
|
setTimeout(async () => { |
|
|
|
|
|
location.replace(logoutUri); |
|
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
|
location.replace(logoutUri); |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
const actionClassName = useEmotionCss(({ token }) => { |
|
|
const actionClassName = useEmotionCss(({ token }) => { |
|
|
|