()
| 87 | }, |
| 88 | |
| 89 | async logout() { |
| 90 | let param = { token: this.token } |
| 91 | if (wsCache.get('user.platformInfo')) { |
| 92 | param = { ...param, ...wsCache.get('user.platformInfo') } |
| 93 | } |
| 94 | const res: any = await AuthApi.logout(param) |
| 95 | this.clear() |
| 96 | if (res) { |
| 97 | window.location.href = res |
| 98 | window.open(res, '_self') |
| 99 | return res |
| 100 | } |
| 101 | if ( |
| 102 | (getQueryString('code') && getQueryString('state')?.includes('oauth2_state')) || |
| 103 | isPlatform() |
| 104 | ) { |
| 105 | const currentPath = getCurrentRouter() |
| 106 | let logout_url = getSQLBotAddr() + '#/login' |
| 107 | if (currentPath) { |
| 108 | logout_url += `?redirect=${currentPath}` |
| 109 | } |
| 110 | window.location.href = logout_url |
| 111 | window.open(res, logout_url) |
| 112 | return logout_url |
| 113 | } |
| 114 | return null |
| 115 | }, |
| 116 | |
| 117 | async info() { |
| 118 | const res: any = await AuthApi.info() |
nothing calls this directly
no test coverage detected