2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2025-01-22 22:11:22 +08:00

获取authkey补充uid显示

This commit is contained in:
Ctrlcvs 2022-12-08 15:44:13 +08:00
parent b66750b84f
commit 0f8b38338b
2 changed files with 18 additions and 10 deletions

View File

@ -184,10 +184,13 @@ export async function gclog(e) {
return true; return true;
} }
async function getAuthKey(e, user) { async function getAuthKey(e, user) {
if(!e.uid){
e.uid=e?.runtime?.user?._regUid
}
e.region = getServer(e.uid) e.region = getServer(e.uid)
let authkeyrow = await user.getData("authKey"); let authkeyrow = await user.getData("authKey",{});
if (!authkeyrow?.data) { if (!authkeyrow?.data) {
e.reply("authkey获取失败" + (authkeyrow.message.includes("登录失效") ? "请重新绑定stoken" : authkeyrow.message)) e.reply(`uid:${e.uid},authkey获取失败` + (authkeyrow.message.includes("登录失效") ? "请重新绑定stoken" : authkeyrow.message))
return false; return false;
} }
return authkeyrow.data["authkey"]; return authkeyrow.data["authkey"];

View File

@ -173,7 +173,7 @@ export default class user {
} }
item.total_sign_day++; item.total_sign_day++;
message += message +=
`${item.nickname}-${item.game_uid}${res.message=="OK"?"签到成功":res.message}\n` `${item.nickname}-${item.game_uid}${res.message == "OK" ? "签到成功" : res.message}\n`
} }
} }
// } // }
@ -222,14 +222,16 @@ export default class user {
return res return res
} }
async cloudSeach() { async cloudSeach() {
let res = await this.getData("cloudGet") //这样会算签到?具体待测试 let res = await this.getData("cloudGet")
if (res?.retcode == -100) { if (res?.retcode == -100) {
res.message = "云原神token失效/防沉迷" res.message = "云原神token失效/防沉迷"
res.isOk = false; res.isOk = false;
} else { } else {
res.isOk = true; res.isOk = true;
res.message = if (res?.data?.total_time) {
`米云币:${res?.data?.coin?.coin_num},免费时长:${res?.data?.free_time?.free_time}分钟,总时长:${res?.data.total_time}分钟`; res.message =
`米云币:${res?.data?.coin?.coin_num},免费时长:${res?.data?.free_time?.free_time}分钟,总时长:${res?.data?.total_time}分钟`;
}
} }
return res; return res;
} }
@ -343,7 +345,7 @@ export default class user {
if (res?.message && res?.retcode == 0) { if (res?.message && res?.retcode == 0) {
Share++; Share++;
} }
message += `共读取帖子记录${20*sumcount}\n浏览成功:${trueDetail}\n点赞成功:${Vote}\n分享成功:${Share}`; message += `共读取帖子记录${20 * sumcount}\n浏览成功:${trueDetail}\n点赞成功:${Vote}\n分享成功:${Share}`;
Bot.logger.mark(`\n用户${this.e.user_id}:\n${message}`) Bot.logger.mark(`\n用户${this.e.user_id}:\n${message}`)
await utils.randomSleepAsync(3); await utils.randomSleepAsync(3);
} }
@ -688,6 +690,9 @@ export default class user {
skuid = BotConfig.NoteCookie[e.user_id]; skuid = BotConfig.NoteCookie[e.user_id];
} }
} }
if (!uid) {
uid = e.runtime?.user?._regUid
}
this.e.uid = uid; this.e.uid = uid;
this.e.cookie = cookie; this.e.cookie = cookie;
return { return {
@ -753,7 +758,7 @@ export default class user {
// ltoken=res?.data?.ltoken // ltoken=res?.data?.ltoken
// } // }
this.e.cookie = this.e.cookie =
`ltoken=${this.e.sk?.get('ltoken')||ltoken};ltuid=${this.e.sk?.get('stuid')};cookie_token=${data.data.cookie_token}; account_id=${this.e.sk?.get('stuid')};` `ltoken=${this.e.sk?.get('ltoken') || ltoken};ltuid=${this.e.sk?.get('stuid')};cookie_token=${data.data.cookie_token}; account_id=${this.e.sk?.get('stuid')};`
// if(this.e.sk?.get('mid')){ // if(this.e.sk?.get('mid')){
// this.e.cookie = // this.e.cookie =
// `ltoken_v2=${this.e.sk?.get('ltoken')||ltoken};cookie_token_v2=${data.data.cookie_token}; account_mid_v2=${this.e.sk.get('mid')};ltmid_v2=${this.e.sk.get('mid')}` // `ltoken_v2=${this.e.sk?.get('ltoken')||ltoken};cookie_token_v2=${data.data.cookie_token}; account_mid_v2=${this.e.sk.get('mid')};ltmid_v2=${this.e.sk.get('mid')}`
@ -762,7 +767,7 @@ export default class user {
this.e.cookie = this.e.original_msg this.e.cookie = this.e.original_msg
} }
res = await this.getData("userGameInfo", this.ForumData[1], false) res = await this.getData("userGameInfo", this.ForumData[1], false)
if(res?.retcode!=0){ if (res?.retcode != 0) {
return false; return false;
} }
let uids = [] let uids = []