From 36b27e561a7c8bf8152b63f2cc9a1154036f43bd Mon Sep 17 00:00:00 2001 From: spiritree Date: Mon, 29 Apr 2019 14:48:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=A8=E5=B1=80=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=94=AF=E6=8C=81=E6=90=9C=E7=B4=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Header/Search/Search.js | 6 +++--- server/models/interface.js | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/components/Header/Search/Search.js b/client/components/Header/Search/Search.js index 6b97bc75..935499df 100755 --- a/client/components/Header/Search/Search.js +++ b/client/components/Header/Search/Search.js @@ -142,9 +142,9 @@ export default class Srch extends Component { defaultActiveFirstOption={false} onSelect={this.onSelect} onSearch={this.handleSearch} - filterOption={(inputValue, option) => - option.props.children.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1 - } + // filterOption={(inputValue, option) => + // option.props.children.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1 + // } > } diff --git a/server/models/interface.js b/server/models/interface.js index 86f2f1be..69fc4a40 100755 --- a/server/models/interface.js +++ b/server/models/interface.js @@ -326,7 +326,10 @@ class interfaceModel extends baseModel { search(keyword) { return this.model .find({ - title: new RegExp(keyword, 'ig') + $or: [ + { 'title': new RegExp(keyword, 'ig') }, + { 'path': new RegExp(keyword, 'ig') } + ] }) .limit(10); }