From 80b5a59228e7615555a152cd9dd75937617f233f Mon Sep 17 00:00:00 2001 From: hqweay Date: Fri, 7 Jun 2019 12:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=B8=8B=E7=9A=84=E6=9D=A1=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/shared/db/mapper/itemMapper.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/shared/db/mapper/itemMapper.js b/src/shared/db/mapper/itemMapper.js index f412ec4..dca0f37 100644 --- a/src/shared/db/mapper/itemMapper.js +++ b/src/shared/db/mapper/itemMapper.js @@ -34,7 +34,17 @@ export function getItemsByTemplateName(temName) { // 通过 标签名 获取 条目 // bug 应该判断 tagName 是否在 tag 列表里 export function getItemsByTagName(tagName) { - return db.read().get('item').filter({ tag_name: tagName }).value() + // 我可太他妈聪明了 + return db.read().get('item').filter(function (o) { + console.log(tagName); + if (o.tag_name.indexOf(tagName) !== -1) { + console.log("true"); + return true; + } else { + console.log("false"); + return false; + } + }).value(); }