From 20703ed64385464801774338e35d9db9e6bc9aae Mon Sep 17 00:00:00 2001 From: fanxb Date: Sun, 2 Feb 2020 00:57:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=B0=86=E5=A4=A7=E5=B0=8F=E5=86=99?= =?UTF-8?q?=E6=95=8F=E6=84=9F=E7=9A=84=E6=90=9C=E7=B4=A2=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=A4=A7=E5=B0=8F=E5=86=99=E4=B8=8D=E6=95=8F?= =?UTF-8?q?=E6=84=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/util/cacheUtil.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/front/src/util/cacheUtil.js b/front/src/util/cacheUtil.js index 9df203c..d4764c9 100644 --- a/front/src/util/cacheUtil.js +++ b/front/src/util/cacheUtil.js @@ -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));