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

Function loadClient

frontend/src/views/login/xpack/PlatformClient.ts:34–75  ·  view source on GitHub ↗
(category: LoginCategory)

Source from the content-addressed store, hash-verified

32 'https://lf1-cdn-tos.bytegoofy.com/goofy/lark/op/h5-js-sdk-1.5.16.js',
33]
34export const loadClient = (category: LoginCategory) => {
35 const type = getQueryString('client')
36 const corpid = getQueryString('corpid')
37 if (type && !category[type as keyof LoginCategory]) {
38 ElMessageBox.confirm(t('login.platform_disable', [t(`user.${type}`)]), {
39 confirmButtonType: 'danger',
40 type: 'warning',
41 showCancelButton: false,
42 confirmButtonText: t('common.refresh'),
43 cancelButtonText: t('dataset.cancel'),
44 autofocus: false,
45 showClose: false,
46 })
47 .then(() => {
48 window.location.reload()
49 })
50 .catch(() => {})
51 return false
52 }
53 if (!type || !flagArray.includes(type) || !category[type as keyof LoginCategory]) {
54 return false
55 }
56 const index = flagArray.indexOf(type)
57 const jsId = `fit2cloud-dataease-v2-platform-client-${type}`
58 const awaitMethod = loadScript(urlArray[index], jsId)
59 awaitMethod
60 .then(() => {
61 if (index === 0) {
62 dingtalkClientRequest(corpid)
63 }
64 if (index === 1) {
65 larkClientRequest()
66 }
67 if (index === 2) {
68 larksuiteClientRequest()
69 }
70 })
71 .catch(() => {
72 ElMessage.error('加载失败')
73 })
74 return true
75}
76
77const dingtalkClientRequest = async (id: string | null) => {
78 if (!id) {

Callers

nothing calls this directly

Calls 9

getQueryStringFunction · 0.90
loadScriptFunction · 0.90
dingtalkClientRequestFunction · 0.85
larkClientRequestFunction · 0.85
larksuiteClientRequestFunction · 0.85
errorMethod · 0.80
tFunction · 0.50
thenMethod · 0.45
includesMethod · 0.45

Tested by

no test coverage detected