fix: 第11轮深度审计修复 — P0 keyset翻页崩溃 + P1布尔符语义/语法误报等16项修复
P0 (1项): - keyset cursor: lit.title or "__NULL__" 空字符串误判为NULL导致后续翻页全空 P1 (6项): - boolean_operator: 仅扫描depth=0的token,括号内AND/OR不再影响顶层操作符判定 - is_pubmed_syntax: 去除AND/OR/NOT检测的IGNORECASE(PubMed仅识别大写布尔符) - _relevance_query: MeSH-only查询(如breast[MAJR])补充原始回退,避免退化到日期排序 - pmid_terms: 缺少try/except int(),补充ValueError+DOI兜底 - 部分日期展开: 2024-01[DP]等YYYY-MM partial date展开为整月范围(DP/EDAT/CRDT) - 前端#N去重: resolveQuery/expandQuery dedup refs防重复引用误判为循环 P2 (9项): - cache: filter-options加入invalidate_search_cache清理 - worker: daily_ftp_update/daily_citation_update异常时finally保证缓存清理 - cursor_val: 空字符串''通过is None检查,补充not cursor_val - keyset UI: 模板条件sort==='date'改为KEYSET_SORTS.has(sort) - resetAllFilters: 补充showCustomYear=false
This commit is contained in:
@@ -41,7 +41,8 @@ export function expandQuery(query: string, entries: HistoryEntry[]): string {
|
||||
if (current === prev) break
|
||||
const refs = current.match(/#(\d+)/g)
|
||||
if (refs) {
|
||||
for (const ref of refs) {
|
||||
const uniqueRefs = [...new Set(refs)]
|
||||
for (const ref of uniqueRefs) {
|
||||
if (seen.has(ref)) return prev // 循环引用 → 返回上次安全结果
|
||||
seen.add(ref)
|
||||
}
|
||||
|
||||
@@ -553,6 +553,7 @@ function resetAllFilters() {
|
||||
sort.value = 'date'
|
||||
booleanOp.value = 'and'
|
||||
exactPhrase.value = false
|
||||
showCustomYear.value = false
|
||||
goToPage(1)
|
||||
}
|
||||
|
||||
@@ -905,7 +906,7 @@ const specialTags = computed(() => filterOptions.value?.special_tags || {})
|
||||
/>
|
||||
|
||||
<!-- Keyset 分页(sort=date,不做 COUNT,纯翻页) -->
|
||||
<div v-if="searched && sort === 'date' && results.length > 0" style="display:flex;justify-content:center;align-items:center;gap:12px;padding:20px">
|
||||
<div v-if="searched && KEYSET_SORTS.has(sort) && results.length > 0" style="display:flex;justify-content:center;align-items:center;gap:12px;padding:20px">
|
||||
<NButton size="small" :disabled="keysetPage <= 1 || loading" @click="goToPage(keysetPage - 1)">← 上一页</NButton>
|
||||
<span style="font-size:13px;color:var(--text-muted)">第 {{ keysetPage }} 页</span>
|
||||
<NButton size="small" :disabled="!keysetHasMore || loading" @click="goToPage(keysetPage + 1)">下一页 →</NButton>
|
||||
|
||||
@@ -228,7 +228,8 @@ function resolveQuery(q: string): string {
|
||||
if (current === prev) break
|
||||
const refs = current.match(/#\d+/g)
|
||||
if (refs) {
|
||||
for (const ref of refs) {
|
||||
const uniqueRefs = [...new Set(refs)]
|
||||
for (const ref of uniqueRefs) {
|
||||
if (seen.has(ref)) return prev
|
||||
seen.add(ref)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user