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