MCPcopy Index your code
hub / github.com/dataease/SQLBot / logout

Function logout

frontend/src/stores/user.ts:89–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 6

getQueryStringFunction · 0.90
isPlatformFunction · 0.90
getCurrentRouterFunction · 0.90
getSQLBotAddrFunction · 0.90
getMethod · 0.65
includesMethod · 0.45

Tested by

no test coverage detected