html 定时执行
<script> $(function () { //默认是发货追溯(供应商)页面 document.getElementById('ViewBackSupp').click(); //判断登录是否过期 setInterval(GetIsHaveOverTime, 5000); }); function GetIsHaveOverTime() { $.ajax({ type: "post", dataType: "json", url: '/Home/GetIsHaveOverTime', //回发到的页面 success: function (data) { //0 未过期 1 已过期 ,过期则返回登录界面 if (data.result == 1) { window.location.href = '/Login/Index'; } } }) } </script>