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

Function larkClientRequest

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

Source from the content-addressed store, hash-verified

96}
97
98const larkClientRequest = async () => {
99 if (!window['tt']) {
100 ElMessage.error('load remote lark js error')
101 return
102 }
103 const res = await queryClientInfo(8)
104 if (!res?.client_id) {
105 ElMessage.error('get client_id error')
106 return
107 }
108 const clientId = res.client_id
109 const callRequestAuthCode = () => {
110 window['tt'].requestAuthCode({
111 appId: clientId,
112 success: (res: any) => {
113 const { code } = res
114 const state = `fit2cloud-lark-client`
115 toUrl(`?code=${code}&state=${state}`)
116 },
117 fail: (error: any) => {
118 const { errno, errString } = error
119 ElMessage.error(`error code: ${errno}, error msg: ${errString}`)
120 },
121 })
122 }
123 if (window['tt'].requestAccess) {
124 window['tt'].requestAccess({
125 appID: clientId,
126 scopeList: [],
127 success: (res: any) => {
128 const { code } = res
129 const state = `fit2cloud-lark-client`
130 toUrl(`?code=${code}&state=${state}`)
131 },
132 fail: (error: any) => {
133 const { errno, errString } = error
134 if (errno === 103) {
135 callRequestAuthCode()
136 } else {
137 ElMessage.error(`error code: ${errno}, error msg: ${errString}`)
138 }
139 },
140 })
141 } else {
142 callRequestAuthCode()
143 }
144}
145
146const larksuiteClientRequest = async () => {
147 if (!window['tt'] || !window['h5sdk']) {

Callers 1

loadClientFunction · 0.85

Calls 4

queryClientInfoFunction · 0.90
toUrlFunction · 0.85
callRequestAuthCodeFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected