From 385422819a80c3c70e78a726d8e7105e59b3e172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 22 Jul 2019 09:08:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 1 - public/react/src/modules/tpm/NewHeader.js | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 528ec6b94..0cc9fd687 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -21,7 +21,6 @@ function locationurl(list){ const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' window._debugType = debugType; - export function initAxiosInterceptors(props) { // TODO 避免重复的请求 https://github.com/axios/axios#cancellation diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 4e61101e3..d09e3ab4c 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -392,6 +392,15 @@ class NewHeader extends Component { // return false; // } } + onSearchhref = (value) => { + window.location.href ="/search?value="+value; + // let code = e.keyCode; + + // if(code == 13) { + // header_search(this); + // return false; + // } + } hideAddcoursestypes=()=>{ @@ -719,7 +728,7 @@ submittojoinclass=(value)=>{ > <Search placeholder="实践课程/翻转课堂/开发社区/交流问答" - // onSearch={value => console.log(value)} + onSearch={this.onSearchhref} onPressEnter={this.onKeywordSearchKeyDown} style={{ width: 300 }} From be5893f43db1441eb9534d0ccec0b2b6a0e638f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 22 Jul 2019 09:12:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/NewHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index d09e3ab4c..d698ebf95 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -728,7 +728,7 @@ submittojoinclass=(value)=>{ > <Search placeholder="实践课程/翻转课堂/开发社区/交流问答" - onSearch={this.onSearchhref} + onSearch={(value)=>this.onSearchhref(value)} onPressEnter={this.onKeywordSearchKeyDown} style={{ width: 300 }}