MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / getSystemList

Function getSystemList

frontend/packages/core/src/pages/system/SystemList.tsx:41–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 private: { text: '私有服务' }
40 })
41 const getSystemList = () => {
42 if (!accessInit) {
43 getGlobalAccessData()?.then?.(() => {
44 getSystemList()
45 })
46 return Promise.resolve({ data: [], success: false })
47 }
48 if (!tableHttpReload) {
49 setTableHttpReload(true)
50 return Promise.resolve({
51 data: tableListDataSource,
52 success: true
53 })
54 }
55 return fetchData<BasicResponse<{ services: SystemTableListItem[] }>>(
56 !checkPermission('system.workspace.service.view_all') ? 'my_services' : 'services',
57 {
58 method: 'GET',
59 eoParams: { keyword: tableSearchWord },
60 eoTransformKeys: ['api_num', 'service_num', 'create_time']
61 }
62 )
63 .then((response) => {
64 const { code, data, msg } = response
65 if (code === STATUS_CODE.SUCCESS) {
66 setTableListDataSource(data.services)
67 setTableHttpReload(false)
68 return { data: data.services, success: true }
69 } else {
70 message.error(msg || $t(RESPONSE_TIPS.error))
71 return { data: [], success: false }
72 }
73 })
74 .catch(() => {
75 return { data: [], success: false }
76 })
77 }
78
79 const getTeamsList = () => {
80 if (!accessInit) {

Callers 1

SystemListFunction · 0.70

Calls 4

$tFunction · 0.90
getGlobalAccessDataFunction · 0.85
checkPermissionFunction · 0.85
fetchDataFunction · 0.50

Tested by

no test coverage detected