From 1a4fdf0d8ac17fec7b2f079a147833bc9abe30f1 Mon Sep 17 00:00:00 2001 From: Ctrlcvs <1509167646@qq.com> Date: Tue, 9 Aug 2022 22:05:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=B8=AAck=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E8=B4=A6=E5=8F=B7=E6=97=A0=E6=B3=95=E7=AD=BE=E5=88=B0?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E8=B4=A6=E5=8F=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sign.js | 2 +- model/mys/mihoyo-api.js | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/sign.js b/apps/sign.js index adfcda2..2efb585 100644 --- a/apps/sign.js +++ b/apps/sign.js @@ -97,7 +97,7 @@ export async function sign(e) { }); }, RETRY_OPTIONS); Bot.logger.info(`${forum.name} 签到结果: [${resObj.message}]`); - resultMessage += `签到: [${resObj.message}]\n`; + resultMessage += `签到: \n${resObj.message}\n`; } catch (e) { Bot.logger.error(`${forum.name} 签到失败 [${e.message}]`); resultMessage += `签到失败: [${e.message}]\n`; diff --git a/model/mys/mihoyo-api.js b/model/mys/mihoyo-api.js index 4297217..f8824e8 100644 --- a/model/mys/mihoyo-api.js +++ b/model/mys/mihoyo-api.js @@ -110,14 +110,18 @@ export default class MihoYoApi { try { // 获取账号信息 const objData = await this.getUserInfo(kkbody) - if (objData.retcode != 200) { - return objData - } - if (!objData.nickname) { + let data=objData.data + if(data?.list?.length==0){ return { message: `未绑定${name}信息` } } + let message=`\n${name}共计${data.list.length}个账号\n`; + for(let item of data.list){ + let objshuj=(await this.postSign(kkbody, item.game_uid, item.region)) + message+=`游戏id:${item.game_uid}:${objshuj.message}\n` + await utils.randomSleepAsync(); + } // 获取签到信息和奖励信息 、、后续重新梳理补充 // const { // name, @@ -129,7 +133,7 @@ export default class MihoYoApi { // } // } // 签到操作 - return await this.postSign(kkbody, objData.game_uid, objData.region) + return {message} } catch (error) { Bot.logger.mark(`error.message`, error.message) } @@ -401,18 +405,14 @@ export default class MihoYoApi { .getpubHeaders(board)).timeout(10000); let resObj = JSON.parse(res.text); let data = resObj.data + // console.log(resObj) if (resObj.retcode != 0) { return resObj } - const game_uid = data?.list?. [0]?.game_uid - const region = data?.list?. [0]?.region - const nickname = data?.list?. [0]?.nickname - return { - game_uid, - region, - nickname, - retcode: 200 - } + // const game_uid = data?.list?. [0]?.game_uid + // const region = data?.list?. [0]?.region + // const nickname = data?.list?. [0]?.nickname + return resObj } // 游戏签到操作 async postSign(board, game_uid, region) {