feat: 知识库递归导入(从指定父节点,不需要空间权限)

- feishu_service.py: import_space_nodes 改为 import_nodes_from_parent
  从指定父节点递归获取子节点,不需要空间级别权限
- admin_knowledge.py: import API 增加 parent_node_token 参数
- api.ts/App.vue: 前端增加父节点 NodeToken 输入框
This commit is contained in:
2026-07-08 18:50:46 +08:00
parent f4196612d4
commit 3598e34819
4 changed files with 129 additions and 0 deletions

View File

@@ -106,6 +106,11 @@ export const api = {
updateKnowledge: (id: number, payload: Record<string, unknown>) =>
request<KnowledgeItem>(`/admin/knowledge/${id}`, { method: "PUT", body: JSON.stringify(payload) }),
deleteKnowledge: (id: number) => request<null>(`/admin/knowledge/${id}`, { method: "DELETE" }),
importKnowledgeFromSpace: (body: Record<string, string>) =>
request<{ imported: number; skipped: number; nodes: { name: string; nodeToken: string; status: string; id?: number }[] }>(
"/admin/knowledge/import",
{ method: "POST", body: JSON.stringify(body) },
),
prompt: () => request<{ promptContent: string }>("/admin/prompt"),
savePrompt: (promptContent: string) =>
request<{ promptContent: string }>("/admin/prompt", { method: "PUT", body: JSON.stringify({ promptContent }) }),