This commit is contained in:
张成
2025-12-18 18:46:29 +08:00
parent 73a0999e20
commit f233f368ed
5 changed files with 77 additions and 30 deletions

View File

@@ -26,8 +26,8 @@ function checkTimeRange(timeRange) {
const startTime = startHour * 60 + startMinute;
const endTime = endHour * 60 + endMinute;
// 检查是否仅工作日
if (timeRange.workdays_only === 1) {
// 检查是否仅工作日(使用宽松比较,兼容字符串和数字)
if (timeRange.workdays_only == 1) { // 使用 == 而不是 ===
const dayOfWeek = now.getDay(); // 0=周日, 1=周一, ..., 6=周六
if (dayOfWeek === 0 || dayOfWeek === 6) {
return { allowed: false, reason: '当前是周末,不在允许的时间范围内' };