浏览代码

!2 if localhost then can use all button

pcacc 4 月之前
父节点
当前提交
08e2d1a1da
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      templates/index_dongri.html

+ 8 - 1
templates/index_dongri.html

@@ -281,7 +281,14 @@
         }
 
         function isWorkingHours() {
-            return false;
+            // 检查是否为本地域名
+            const isLocalDomain = window.location.hostname === 'localhost' || 
+                                window.location.hostname === '127.0.0.1' || 
+                                window.location.hostname === '';
+            
+            if (isLocalDomain) {
+                return false;
+            }
             const now = new Date();
             const day = now.getDay(); // 0是周日,1是周一,...,6是周六
             const hours = now.getHours();