// 如果10分钟没有操作,退出到登录页
    var timer;
    function startTimer(){
        clearTimeout(timer);
        timer=setTimeout(function(){
            // 清空缓存和token
            $cookies.remove("access_token", { path: "/" });
            $cookies.remove("userName", { path: "/" });
            $cookies.remove("userId", { path: "/" });
            $cookies.remove("roleName", { path: "/" });
            $cookies.remove("userCount", { path: "/" });
            window.location.href = "/index.html"
        },10*60*1000);
    }
    document.onmousemove=document.onmousedown=startTimer

 

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-12-31
  • 2021-11-04
  • 2022-12-23
  • 2021-12-24
相关资源
相似解决方案