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

Function larksuiteClientRequest

frontend/src/views/login/xpack/PlatformClient.ts:146–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144}
145
146const larksuiteClientRequest = async () => {
147 if (!window['tt'] || !window['h5sdk']) {
148 ElMessage.error('load remote lark js error')
149 return
150 }
151 const res = await queryClientInfo(9)
152 if (!res?.client_id) {
153 ElMessage.error('get client_id error')
154 return
155 }
156 const clientId = res.client_id
157
158 window['h5sdk'].ready(() => {
159 window['tt'].requestAuthCode({
160 appId: clientId,
161 success(res: any) {
162 const code = res?.code || res
163 const state = `fit2cloud-larksuite-client`
164 toUrl(`?code=${code}&state=${state}`)
165 },
166 fail(error: any) {
167 const { errno, errString } = error
168 ElMessage.error(`error code: ${errno}, error msg: ${errString}`)
169 },
170 })
171 })
172}
173
174const toUrl = (url: string) => {
175 const { origin, pathname } = window.location

Callers 1

loadClientFunction · 0.85

Calls 2

queryClientInfoFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected