搜索bug

This commit is contained in:
tangly1024.com
2023-12-27 17:28:14 +08:00
parent 86c2330fd3
commit a6ee3d6f4a
2 changed files with 4 additions and 4 deletions

View File

@@ -113,7 +113,7 @@ const isIterable = obj =>
async function filterByMemCache(allPosts, keyword) {
const filterPosts = []
if (keyword) {
keyword = keyword.trim()
keyword = keyword.trim().toLowerCase()
}
for (const post of allPosts) {
const cacheKey = 'page_block_' + post.id
@@ -131,7 +131,7 @@ async function filterByMemCache(allPosts, keyword) {
if (!c) {
continue
}
const index = c.toLowerCase().indexOf(keyword.toLowerCase())
const index = c.toLowerCase().indexOf(keyword)
if (index > -1) {
hit = true
hitCount += 1