From 1e3ce12d9392be5b611c8da76e6d4cea3032bf33 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 12 Jul 2021 17:00:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=88=87=E6=8D=A2=E6=97=B6?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E6=B2=A1=E6=9C=89=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=88=B0=E9=A1=B6=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 3 +-- src/forge/Index.js | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 77f5a53dd..3545cd1d0 100644 --- a/src/App.js +++ b/src/App.js @@ -89,7 +89,7 @@ class App extends Component { mygetHelmetapi: null, } } - + HideAddcoursestypess = (i) => { this.setState({ Addcoursestype: false, @@ -108,7 +108,6 @@ class App extends Component { document.title = "loading..."; initAxiosInterceptors(this.props); this.getAppdata(); - window.addEventListener('error', (event) => { const msg = `${event.type}: ${event.message}`; }); diff --git a/src/forge/Index.js b/src/forge/Index.js index 057444e9a..e1402d227 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -27,6 +27,14 @@ const ProjectDetail = Loadable({ }); class Index extends Component { + componentDidUpdate=(preProps)=>{ + this.props.history.listen(()=>{ + if (document.body.scrollTop || document.documentElement.scrollTop > 0) { + window.scrollTo(0, 0); + } + }) + } + render() { return (