()
| 1226 | } |
| 1227 | |
| 1228 | async function searchWiki() { |
| 1229 | const userId = ensureUser(); |
| 1230 | const q = $("wikiQuery").value || ""; |
| 1231 | setStatus("检索知识库", true); |
| 1232 | const data = await api(`/api/wiki/search?user_id=${encodeURIComponent(userId)}&q=${encodeURIComponent(q)}`); |
| 1233 | renderWikiResults(data.nodes || []); |
| 1234 | setStatus("知识库检索完成"); |
| 1235 | } |
| 1236 | |
| 1237 | function renderWikiResults(nodes) { |
| 1238 | if (!nodes.length) { |
nothing calls this directly
no test coverage detected