From 41280019f60bf04344dcfb50d1eb7529db2d7c9f Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Fri, 20 Oct 2023 23:04:16 +0800 Subject: [PATCH] log content contains config name --- src/config.js | 4 ++-- src/index.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/config.js b/src/config.js index 277b9d4..64cb6a7 100644 --- a/src/config.js +++ b/src/config.js @@ -166,7 +166,7 @@ exports.SendLog = function ( ); }; -exports.SendResult = function (transporter, mailfrom, mailto, content) { +exports.SendResult = function (transporter, mailfrom, mailto, content, key) { transporter.sendMail( { from: `"Genshin Cloud Game Helper" <${mailfrom}>`, //邮件来源 @@ -178,7 +178,7 @@ exports.SendResult = function (transporter, mailfrom, mailto, content) { if (error) { return console.log(error); } - log.info(`已发送通知至${mailto}`); + log.info(`${key} - 已发送通知至${mailto}`); } ); }; diff --git a/src/index.js b/src/index.js index b89f84d..87edf48 100644 --- a/src/index.js +++ b/src/index.js @@ -70,7 +70,8 @@ const nodemailer = require("nodemailer"); transporter, globalConfig.mailConfig.user, configs[key].email, - `签到完毕! 获得时长:${WalletRespond.data.free_time.send_freetime}分钟,总时长:${WalletRespond.data.free_time.free_time}分钟` + `签到完毕! 获得时长:${WalletRespond.data.free_time.send_freetime}分钟,总时长:${WalletRespond.data.free_time.free_time}分钟`, + key ); } let NotificationLength = NotificationRespond.data.list.length; @@ -92,7 +93,8 @@ const nodemailer = require("nodemailer"); transporter, globalConfig.mailConfig.user, configs[key].email, - "签到失败" + "签到失败", + key ); } }