mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
chore: refactor tool loading logic to improve shared tool handling
--bug=1060756 --user=刘瑞斌 【应用】AI对话节点的工具,无法获取共享工具 https://www.tapd.cn/62980211/s/1760222
This commit is contained in:
parent
72fd741fbc
commit
925cedec28
|
|
@ -196,13 +196,17 @@ function getList() {
|
|||
const folder_id = currentFolder.value?.id || user.getWorkspaceId()
|
||||
loadSharedApi({
|
||||
type: 'tool',
|
||||
systemType: apiType.value,
|
||||
isShared: folder_id === 'share',
|
||||
systemType: 'workspace',
|
||||
}).getToolList({
|
||||
folder_id: folder_id,
|
||||
tool_type: 'CUSTOM'
|
||||
}).then((res: any) => {
|
||||
toolList.value = res.data?.tools || res.data || []
|
||||
toolList.value = toolList.value?.filter((item: any) => item.is_active)
|
||||
searchData.value = res.data.tools || res.data
|
||||
searchData.value = searchData.value?.filter((item: any) => item.is_active)
|
||||
})
|
||||
.getToolList({ folder_id }, apiLoading)
|
||||
.then((res: any) => {
|
||||
toolList.value = uniqueArray([...toolList.value, ...res.data.tools], 'id')
|
||||
searchData.value = res.data.tools
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
|
|
|
|||
Loading…
Reference in New Issue