We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题:
/** * 根据用户输入的提问,向知识库获取回答 * @param question 用户提问 * @return UseAxiosReturn 知识库回答 */ function getAnswerList(id: string, question: string) { useAxiosApi(`/knowledgebase/${id}/search`, { method: 'GET', params: { query: question }, headers: { 'Content-Type': 'application/json' } }).then((res) => { console.log(res) //请问这里要怎么样才能取出数据? }).catch(() => { }); }
打印res之后的内容为:
{ "code": 200, "items": [ { "content": "content", "identify": "1767763096417337344", "metadata": { "seq_num": 54 }, "score": 0.7338999207181424 }, { "content": "content2", "identify": "1767763096417337344", "metadata": { "seq_num": 12 }, "score": 0.6277636422458995 }, ], "totalCount": 10 }
res的类型为res: StrictUseAxiosReturn<any, AxiosResponse<any, any>, any>,那我怎么样才能取到我想要的items里的内容呢。还没有学ts就开始写项目了,但时间又比较紧,感谢大佬了
The text was updated successfully, but these errors were encountered:
res.items 不就取到了吗?
res.items
Sorry, something went wrong.
No branches or pull requests
如题:
打印res之后的内容为:
res的类型为res: StrictUseAxiosReturn<any, AxiosResponse<any, any>, any>,那我怎么样才能取到我想要的items里的内容呢。还没有学ts就开始写项目了,但时间又比较紧,感谢大佬了
The text was updated successfully, but these errors were encountered: