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

@ -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;
if (res?.data?.total_time) {
res.message = res.message =
`米云币:${res?.data?.coin?.coin_num},免费时长:${res?.data?.free_time?.free_time}分钟,总时长:${res?.data.total_time}分钟`; `米云币:${res?.data?.coin?.coin_num},免费时长:${res?.data?.free_time?.free_time}分钟,总时长:${res?.data?.total_time}分钟`;
}
} }
return res; return res;
} }
@ -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 {