diff --git a/globals/static/index.html b/globals/static/index.html index c817a33..8fd5f25 100644 --- a/globals/static/index.html +++ b/globals/static/index.html @@ -180,7 +180,11 @@ } socket.onclose = event => { console.log("WebSocket closed. Reconnecting..."); - setInterval(reloadHtml, 3000); + // 使用媒体查询判断设备类型 + const isMobile = window.matchMedia('(max-width: 767px)').matches; + if (!isMobile) { + setInterval(reloadHtml, 3000); + } }; // Send heartbeat message every 120 seconds const sendHeartbeat = () => {