diff --git a/cron_task/offline_monitoring.go b/cron_task/offline_monitoring.go index d9bb0de..3052d6a 100644 --- a/cron_task/offline_monitoring.go +++ b/cron_task/offline_monitoring.go @@ -41,7 +41,7 @@ func offlineMonitoring() { isOnline := time.Since(p.LastHandshakeTime).Minutes() < 3 // 未离线 - if !isOnline { + if isOnline { continue } @@ -51,7 +51,7 @@ func offlineMonitoring() { content += fmt.Sprintf("最后握手时间:%s\r\n", p.LastHandshakeTime.Format("2006-01-02 15:04:05")) // 离线并且配置了邮箱,准备发送邮件 - err = utils.Mail().SendMail(clientInfo.Email, fmt.Sprintf("客户端离线通知"), content, "") + err = utils.Mail().SendMail(clientInfo.Email, fmt.Sprintf("客户端[%s]离线通知", clientInfo.Name), content, "") if err != nil { log.Errorf("发送离线通知邮件失败: %v", err.Error()) continue