remove unused

This commit is contained in:
Zichao Lin 2023-08-27 23:26:23 +08:00
parent 0d428f5e9c
commit 4259c8d901
Signed by: earthjasonlin
GPG Key ID: 406D9913DE2E42FB
2 changed files with 3 additions and 20 deletions

@ -1,6 +1,5 @@
const { exit } = require("process")
const fs = require("fs")
const nodemailer = require('nodemailer')
const { default: axios } = require("axios")
const { log } = require("./logger")
@ -67,7 +66,6 @@ exports.getGlobalConfig = function() {
}
exports.getConfigs = function(){
// var configsList;
try {
var configsList = fs.readdirSync("configs")
} catch(e) {
@ -91,23 +89,17 @@ exports.getConfigs = function(){
exports.checkConfigs = function(configs){
for(file in configs) {
var configThis = configs[file];
var isNoProbem = true;
for(key in configKeys) {
if(configThis[configKeys[key]] == "" || configThis[configKeys[key]] == undefined || configThis[configKeys[key]] == null || configThis[configKeys[key]] == NaN) {
log.error(`配置文件 ${file} 异常:`);
log.error(` —— ${configKeys[key]}字段缺失`);
// isNoProbem = false;
}
}
// if(!isNoProbem) {
// exit();
// }
}
}
// var appversion = exports.AppVersion();
exports.makeHeader = function(data,appversion){
return {
"x-rpc-combo_token": data.token,
@ -139,7 +131,7 @@ exports.SendLog = function(transporter,mailfrom,mailto,successNum,totalNum,conte
subject: `今日已签到${successNum}/${totalNum}名用户`, // 邮件主题
text: '☺️😍😎', // 存文本类型的邮件正文
html: `${content}` // html类型的邮件正文
}, (error, info) => {
}, (error) => {
if (error) {
return console.log(error);
}

@ -1,9 +1,4 @@
const fs = require("fs")
const reggol = require("reggol")
const { getConfigs, checkConfigs, makeHeader, ListNotification, AckNotification, Wallet, SendLog, AppVersion, getGlobalConfig } = require("./config")
const urlconfig = require("./config")
const { log, addLogContent, getLogs } = require("./logger");
@ -26,7 +21,6 @@ const nodemailer = require("nodemailer");
});
}
var configs = getConfigs();
// console.log(configs);
log.info(`正在检测配置有效性`)
checkConfigs(configs)
log.info("检测完毕!")
@ -59,9 +53,6 @@ const nodemailer = require("nodemailer");
} else {
log.error("签到失败")
}
// log.info(`Wallet ${Wallet(makeHeader(configs[key])).StringVersion}`)
// log.info(`Announcement ${Announcement(makeHeader(configs[key])).StringVersion}`)
// console.log(makeHeader(configs[key]));
}
if (globalConfig.sendMail == true) {