2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 11:40:51 +08:00

修正一个ck多个账号无法签到多个账号问题

This commit is contained in:
Ctrlcvs 2022-08-09 22:05:57 +08:00 committed by leiyilu
parent 394345de13
commit 1a4fdf0d8a
2 changed files with 15 additions and 15 deletions

View File

@ -97,7 +97,7 @@ export async function sign(e) {
}); });
}, RETRY_OPTIONS); }, RETRY_OPTIONS);
Bot.logger.info(`${forum.name} 签到结果: [${resObj.message}]`); Bot.logger.info(`${forum.name} 签到结果: [${resObj.message}]`);
resultMessage += `签到: [${resObj.message}]\n`; resultMessage += `签到: \n${resObj.message}\n`;
} catch (e) { } catch (e) {
Bot.logger.error(`${forum.name} 签到失败 [${e.message}]`); Bot.logger.error(`${forum.name} 签到失败 [${e.message}]`);
resultMessage += `签到失败: [${e.message}]\n`; resultMessage += `签到失败: [${e.message}]\n`;

View File

@ -110,14 +110,18 @@ export default class MihoYoApi {
try { try {
// 获取账号信息 // 获取账号信息
const objData = await this.getUserInfo(kkbody) const objData = await this.getUserInfo(kkbody)
if (objData.retcode != 200) { let data=objData.data
return objData if(data?.list?.length==0){
}
if (!objData.nickname) {
return { return {
message: `未绑定${name}信息` 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 { // const {
// name, // name,
@ -129,7 +133,7 @@ export default class MihoYoApi {
// } // }
// } // }
// 签到操作 // 签到操作
return await this.postSign(kkbody, objData.game_uid, objData.region) return {message}
} catch (error) { } catch (error) {
Bot.logger.mark(`error.message`, error.message) Bot.logger.mark(`error.message`, error.message)
} }
@ -401,18 +405,14 @@ export default class MihoYoApi {
.getpubHeaders(board)).timeout(10000); .getpubHeaders(board)).timeout(10000);
let resObj = JSON.parse(res.text); let resObj = JSON.parse(res.text);
let data = resObj.data let data = resObj.data
// console.log(resObj)
if (resObj.retcode != 0) { if (resObj.retcode != 0) {
return resObj return resObj
} }
const game_uid = data?.list?. [0]?.game_uid // const game_uid = data?.list?. [0]?.game_uid
const region = data?.list?. [0]?.region // const region = data?.list?. [0]?.region
const nickname = data?.list?. [0]?.nickname // const nickname = data?.list?. [0]?.nickname
return { return resObj
game_uid,
region,
nickname,
retcode: 200
}
} }
// 游戏签到操作 // 游戏签到操作
async postSign(board, game_uid, region) { async postSign(board, game_uid, region) {