fix: stupid mistake

This commit is contained in:
HuanLinOTO 2023-08-27 22:15:01 +08:00
parent 0807aa1052
commit 16c53ef012
3 changed files with 13 additions and 11 deletions

@ -11,28 +11,28 @@ exports.AnnouncementURL = 'https://api-cloudgame.mihoyo.com/hk4e_cg_cn/gamer/api
exports.AppVersionURL = 'https://api-takumi.mihoyo.com/ptolemaios/api/getLatestRelease?app_id=1953443910&app_version=3.3.0&channel=mihoyo'
exports.Notification = async function(header) {
let tmp = (await axios("GET",exports.NotificationURL,{
let tmp = (await axios(exports.NotificationURL,{
headers:header
})).data;
tmp.StringVersion = JSON.stringify(tmp);
return tmp;
}
exports.Wallet = async function(header) {
let tmp = (await axios("GET",exports.WalletURL,{
let tmp = (await axios(exports.WalletURL,{
headers:header
})).data;
tmp.StringVersion = JSON.stringify(tmp);
return tmp;
}
exports.Announcement = async function(header) {
let tmp = (await axios("GET",exports.AnnouncementURL,{
let tmp = (await axios(exports.AnnouncementURL,{
headers:header
})).data;
tmp.StringVersion = JSON.stringify(tmp);
return tmp;
}
exports.AppVersion = async function() {
let tmp = (await axios("GET",exports.AppVersionURL)).data;
let tmp = (await axios(exports.AppVersionURL)).data;
tmp.StringVersion = JSON.stringify(tmp);
return tmp;
}

@ -5,7 +5,7 @@ const reggol = require("reggol")
const { getConfigs, checkConfigs, makeHeader, Notification, Wallet, SendLog, AppVersion, getGlobalConfig } = require("./config")
const urlconfig = require("./config")
const { log } = require("./logger")
const { log, addLogContent } = require("./logger");
(async () => {
log.info("开始获取全局配置")
@ -38,9 +38,9 @@ const { log } = require("./logger")
log.info(`正在执行配置 ${key}`)
log.info("尝试签到……")
var WalletRespond = await Wallet(makeHeader(configs[key]),appversion);
logContent += `<span style="color: orange">${key} Wallet返回体 <br> ${JSON.stringify(WalletRespond)}</span><br>`;
addLogContent(`<span style="color: orange">${key} Wallet返回体 <br> ${JSON.stringify(WalletRespond)}</span><br>`);
var NotificationRespond = await Notification(makeHeader(configs[key]));
logContent += `<span style="color: orange">${key} Notification返回体 <br> ${JSON.stringify(NotificationRespond)}</span><br>`;
addLogContent(`<span style="color: orange">${key} Notification返回体 <br> ${JSON.stringify(NotificationRespond)}</span><br>`);
if(WalletRespond.data != null) {
if(WalletRespond.data.free_time.free_time != undefined) {
successNum ++;

@ -1,7 +1,9 @@
const reggol = require("reggol")
const baseLogger = new reggol("GenshinCloudPlayHelper")
var logContent = ``
let logContent = ``
exports.addLogContent = function(content) {
logContent += content
}
exports.log = {
info(content) {
logContent += `<strong style="color: green">[info]</strong> ${content}<br>`