diff --git a/src/pages/home/home.js b/src/pages/home/home.js index e2edc872..acc70626 100644 --- a/src/pages/home/home.js +++ b/src/pages/home/home.js @@ -63,7 +63,6 @@ let timerstop = null; export default class App extends Component { constructor(props) { super(props); - window["mydata"] = this; } state = { visible: false, @@ -151,9 +150,6 @@ export default class App extends Component { path: "/home/order-list", }, ], - lastTime: new Date().getTime(), - currentTime: new Date().getTime(), - timeOut: 15 * 60 * 1000, //设置超时时间: 1分 }; componentDidMount(e) { @@ -227,25 +223,7 @@ export default class App extends Component { this.getUserInfuFn(); this.setState({ pathname: `${pathnamestr}` }); sessionStorage.setItem("showflag", true); - window.document.addEventListener("mouseover", function () { - window["mydata"].setState({ lastTime: new Date().getTime() }); //更新操作时间 - }); - //根据权限菜单进行匹配 - - // timerstop=window.setInterval( window["mydata"].testTime, 1000); } - // testTime(){ - // window["mydata"].setState({'currentTime':new Date().getTime()});//更新当前时间 - // if( window["mydata"].state.currentTime - window["mydata"].state.lastTime > window["mydata"].state.timeOut){ //判断是否超时 - // window.clearInterval(timerstop) - // Notify.clear() - // Notify.warn('登录失效,请重新登录!') - // sessionStorage.clear(); - // setTimeout(()=>{ - // window["mydata"].props.history.push('/login'); - // },5000); - // } - // } componentWillReceiveProps(nextProps) { //5分钟更新一次商品数据 let datetime = sessionStorage.getItem("updatetime");