Skip to content

Commit

Permalink
fix: 过滤掉非文档类型的知识库
Browse files Browse the repository at this point in the history
  • Loading branch information
vagusX committed Jul 31, 2023
1 parent 6c4398a commit f885cde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ const RequestProxy = {
offset: 0,
},
});
return data.data;
return Array.isArray(data?.data)
// 过滤掉非文档类型的知识库
? data.data.filter(b => b.type === 'Book')
: [];
} catch (error) {
const err = new Error();
(err as any).html = error.response?.data?.html;
Expand Down

0 comments on commit f885cde

Please sign in to comment.