fix:将大小写敏感的搜索逻辑改为大小写不敏感
This commit is contained in:
parent
e35433b178
commit
20703ed643
@ -196,12 +196,15 @@ export async function keySearch(content) {
|
||||
continue;
|
||||
}
|
||||
if (!item.lowName) {
|
||||
item.lowName = item.name.toLocaleLowerCase();
|
||||
item.lowName = item.name + "////" + item.name.toLocaleLowerCase();
|
||||
}
|
||||
if (!item.lowUrl) {
|
||||
item.lowUrl = item.url.toLocaleLowerCase();
|
||||
item.lowUrl = item.url + "////" + item.url.toLocaleLowerCase();
|
||||
}
|
||||
if (item.name.indexOf(content) > -1 || item.url.indexOf(content) > -1) {
|
||||
if (
|
||||
item.lowName.indexOf(content) > -1 ||
|
||||
item.lowUrl.indexOf(content) > -1
|
||||
) {
|
||||
res.push(item);
|
||||
if (res.length >= 12) {
|
||||
console.info("搜索耗时:" + (Date.now() - time1));
|
||||
|
Loading…
x
Reference in New Issue
Block a user