fix: kb_list only show org KBs (no NULL); tag_form close popup before refresh (remove alert)

This commit is contained in:
yumoqing 2026-08-06 13:40:30 +08:00
parent 7b99ebd16e
commit 70f8f27abb
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ userorgid = await env.get_userorgid()
cards = []
async with get_sor_context(env, 'rag') as sor:
recs = await sor.sqlExe(
"SELECT * FROM knowledge_bases WHERE org_id=${org_id}$ OR org_id IS NULL ORDER BY created_at DESC",
"SELECT * FROM knowledge_bases WHERE org_id=${org_id}$ ORDER BY created_at DESC",
{"org_id": userorgid})
for r in recs:
doc_count = r.doc_count or 0

View File

@ -129,7 +129,7 @@ submit_js = ("var rows=document.querySelectorAll('#tag_list_panel [data-sel]');"
"if(ids.length===0){alert('请至少勾选一个标签');return};"
"fetch('/api/tag/sync?kb_id=" + kb_id + "&media_type=document&media_id=" + doc_id + "&tag_ids='+encodeURIComponent(ids.join(',')))"
".then(function(r){return r.json()}).then(function(d){"
"if(d&&d.status==='SUCCEEDED'){" + refresh_js + "alert('已保存:新增 '+d.added+' 个,移除 '+d.removed+' 个');" + close_popup_js + "}"
"if(d&&d.status==='SUCCEEDED'){" + close_popup_js + refresh_js + "}"
"else{alert('保存失败:'+(d&&d.error||'未知错误'));}"
"}).catch(function(){alert('网络错误')});")