2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-22 19:10:53 +08:00

fix:兼容喵崽(有狗,我不说是谁)

This commit is contained in:
ctrlcvs 2023-06-01 21:58:24 +08:00
parent 36a6eb1f28
commit 33ee4fd09e
2 changed files with 39 additions and 20 deletions

View File

@ -202,9 +202,7 @@ export default class mysTopLogin {
order["pay_type"] = iswx
order["pay_vendor"] = iswx
}
console.log(order)
let res = await this.user.getData('createOrder', { order, headers: { "x-rpc-device_id": device_id } })
console.log(res)
if (!res) return false;
if (res?.code != 200 && res?.retcode != 0) {
this.e.reply('生成充值订单失败:' + res.message)

View File

@ -369,7 +369,29 @@ export default class user {
let userIdList = [];
let dir = './data/MysCookie/'
if (isV3) {
if (!fs.existsSync(dir)) {
let NoteUser = (await import(`file://${_path}/plugins/genshin/model/mys/NoteUser.js`)).default
await NoteUser.forEach(async (user) => {
await user.eachMysUser(async (mys) => {
let { qq } = user
let { ck, ltuid, device_id } = mys
if (Object.keys(userIdList).includes(qq+'')) {
let seed_id = lodash.sample('abcdefghijklmnopqrstuvwxyz', 4).replace(/,/g, '')
userIdList[qq + seed_id] = {
qq, ck, device_id,
ltuid,
}
} else {
userIdList[qq] = {
qq, ck, device_id,
ltuid,
}
}
})
})
} else {
userIdList = (await gsCfg.getBingAllCk()).ckQQ
}
} else {
userIdList = NoteCookie;
}
@ -440,10 +462,11 @@ export default class user {
}
}
for (let qq of userIdkeys) {
let user_id = qq;
let user_id = qq.replace(/\s+(?:n$)?/gi, '');
let ltuid=userIdList[qq]?.ltuid
let e = {
user_id,
qq,
qq: user_id,
isTask: true,
uid: userIdList[qq].uid,
cookie: userIdList[qq].cookie || userIdList[qq].ck,
@ -453,7 +476,7 @@ export default class user {
} else {
e.msg = "全部"
}
Bot.logger.mark(`正在为qq${user_id}米社签到中...`);
Bot.logger.mark(`正在为qq:${user_id},通行证id:${ltuid}米社签到中...`);
this.e = e;
let res = await this.multiSign(this.getDataList(e.msg));
@ -463,7 +486,7 @@ export default class user {
return;
}
if (msg.includes("OK")) {
utils.relpyPrivate(qq, msg + "\n自动签到成功");
utils.relpyPrivate(user_id, msg + "\n自动签到成功");
}
};
e.reply(res.message)
@ -713,14 +736,12 @@ export default class user {
skuid = await gsCfg.getBingCookie(e.user_id);
cookie = skuid?.ck;
uid = skuid?.item;
if (!uid && e.user?.mainUid) { //获取uid为空时进行后续处理获取 (临时处理方式后续会进行解耦以避免这种情况。。待咕中.)s
uid = e.user?.mainUid[e.isSr ? 'sr' : 'gs'] //由于目前只支持原神功能暂时先写死
lodash.mapValues(e.user.mysUsers, function (o) {
if (o.uids[e.isSr ? 'sr' : 'gs'].includes(uid)) {
cookie = o.ck
}
});
if (!uid && e.user) {
uid = e.user.getUid('gs')
cookie = e.user.mysUser.ck
}
// if (!uid && e.user) { //获取uid为空时进行后续处理获取 (临时处理方式后续会进行解耦以避免这种情况。。待咕中.)s
// }
} else {
if (NoteCookie[e.user_id]) {
cookie = NoteCookie[e.user_id].cookie;