From c85203b8e6915b2358e881a82466d524d9305c6b Mon Sep 17 00:00:00 2001 From: fanxb Date: Tue, 10 Mar 2020 22:17:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=90=8E=E6=B2=A1=E6=9C=89=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/components/Search/index.jsx | 13 ++----------- front/src/setupProxy.js | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/front/src/components/Search/index.jsx b/front/src/components/Search/index.jsx index 958eba9..2338b5a 100644 --- a/front/src/components/Search/index.jsx +++ b/front/src/components/Search/index.jsx @@ -42,11 +42,7 @@ class Search extends React.Component { this.clearTimer(); return; } - this.clearTimer(); - this.timer = setTimeout(async () => { - await this.search(content); - this.clearTimer(); - }, 200); + this.search(content); } clearTimer() { @@ -63,13 +59,8 @@ class Search extends React.Component { this.setState({ resultList: [] }); return; } - // httpUtil - // .get( - // "/bookmark/searchUserBookmark?content=" + encodeURIComponent(content) - // ) - // .then(res => this.setState({ resultList: res })); let resultList = await keySearch(content); - this.setState({ resultList }); + this.setState({ resultList, currentIndex: 0 }); } /** diff --git a/front/src/setupProxy.js b/front/src/setupProxy.js index 3ba6b52..d8f144a 100644 --- a/front/src/setupProxy.js +++ b/front/src/setupProxy.js @@ -4,7 +4,7 @@ module.exports = function(app) { app.use( proxy("/bookmark/api/**", { target: "http://localhost:8088/", - // target: "http://ali.tapme.top:8083/", + // target: "http://west.tapme.top:8083/", changeOrigin: true }) );