diff --git a/src/App.js b/src/App.js index 77f5a53d..3545cd1d 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 057444e9..e1402d22 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 (