fix issue #544
This commit is contained in:
叡山电车
2018-08-27 23:00:01 +08:00
committed by DIYgod
parent 7cba2901fe
commit b83a6786fb
2 changed files with 3 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ module.exports = async (ctx, next) => {
if (ctx.state.data && ctx.query && (ctx.query.filter || ctx.query.filter_title || ctx.query.filter_description)) {
ctx.state.data.item = ctx.state.data.item.filter((item) => {
const title = item.title;
const description = item.description;
const description = item.description || title;
return !(
(ctx.query.filter && !title.match(ctx.query.filter) && !description.match(ctx.query.filter)) ||
(ctx.query.filter_title && !title.match(ctx.query.filter_title)) ||