Просмотр исходного кода

!2 if localhost then can use all button

pcacc 4 месяцев назад
Родитель
Сommit
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();