Merge pull request #2 from earthjasonlin/main

fix some bugs
This commit is contained in:
多玩幻灵qwq 2023-01-12 12:15:22 +08:00 committed by GitHub
commit 4f56b114b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 12 deletions

3
.gitignore vendored Normal file

@ -0,0 +1,3 @@
configs/
node_modules/
pnpm-lock.yaml

@ -87,14 +87,13 @@ exports.checkConfigs = function(configs){
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; // isNoProbem = false;
break;
} }
} }
if(!isNoProbem) { // if(!isNoProbem) {
exit(); // exit();
} // }
} }
} }

@ -48,7 +48,7 @@ log.info("检测完毕!")
log.info("正在获取版本号") log.info("正在获取版本号")
var appversion = AppVersion(); var appversion = AppVersion();
appversion = appversion.data.config["cg.key_function_controller"].versions[appversion.data.config["cg.key_function_controller"].versions.length-1] appversion = appversion.data.config["cg.key_function_video_mode"].versions["0"]
log.info(`获取成功!当前版本号:${appversion}`) log.info(`获取成功!当前版本号:${appversion}`)
var successNum = 0,totalNum = 0; var successNum = 0,totalNum = 0;
for(key in configs) { for(key in configs) {
@ -59,6 +59,7 @@ for(key in configs) {
logContent += `<span style="color: orange">${key} Wallet返回体 <br> ${JSON.stringify(WalletRespond)}</span><br>`; logContent += `<span style="color: orange">${key} Wallet返回体 <br> ${JSON.stringify(WalletRespond)}</span><br>`;
var NotificationRespond = Notification(makeHeader(configs[key])); var NotificationRespond = Notification(makeHeader(configs[key]));
logContent += `<span style="color: orange">${key} Notification返回体 <br> ${JSON.stringify(NotificationRespond)}</span><br>`; logContent += `<span style="color: orange">${key} Notification返回体 <br> ${JSON.stringify(NotificationRespond)}</span><br>`;
if(WalletRespond.data != null) {
if(WalletRespond.data.free_time.free_time != undefined) { if(WalletRespond.data.free_time.free_time != undefined) {
successNum ++; successNum ++;
log.info(`签到完毕! 剩余时长:${WalletRespond.data.free_time.free_time}分钟`) log.info(`签到完毕! 剩余时长:${WalletRespond.data.free_time.free_time}分钟`)
@ -69,6 +70,9 @@ for(key in configs) {
} else { } else {
log.error("签到失败") log.error("签到失败")
} }
} else {
log.error("签到失败")
}
// log.info(`Wallet ${Wallet(makeHeader(configs[key])).StringVersion}`) // log.info(`Wallet ${Wallet(makeHeader(configs[key])).StringVersion}`)
// log.info(`Announcement ${Announcement(makeHeader(configs[key])).StringVersion}`) // log.info(`Announcement ${Announcement(makeHeader(configs[key])).StringVersion}`)
// console.log(makeHeader(configs[key])); // console.log(makeHeader(configs[key]));