template: move js session refresh to single file ; use fetch API

这个提交包含在:
Albert S. 2019-08-26 21:21:47 +02:00
父节点 5c3dc9982f
当前提交 327c0793d1
共有 3 个文件被更改,包括 7 次插入16 次删除

查看文件

@ -5,14 +5,7 @@
</ul>
</footer>
<script>
function refreshSession()
{
var req = new XMLHttpRequest();
req.open("GET", "{qswiki:config:refreshsessionurl}");
req.send();
setTimeout(refreshSession, 60*2*1000);
}
setTimeout(refreshSession, 60*2*1000);
{qswiki:include:js_session_refresh}
</script>
</body>
</html>

查看文件

@ -0,0 +1,5 @@
function refreshSession()
{
fetch(new Request("{qswiki:config:refreshsessionurl}"));
}
setInterval(refreshSession, 60*2*1000);

查看文件

@ -7,14 +7,7 @@
</ul>
</footer>
<script>
function refreshSession()
{
var req = new XMLHttpRequest();
req.open("GET", "{qswiki:config:refreshsessionurl}");
req.send();
setTimeout(refreshSession, 60*2*1000);
}
setTimeout(refreshSession, 60*2*1000);
{qswiki:include:js_session_refresh}
</script>
</body>
</html>