mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2024-12-23 03:20:52 +08:00
修改salt到2.36.1,修正刷新ck逻辑
This commit is contained in:
parent
dcf3b928a1
commit
c81e0518fb
@ -62,7 +62,7 @@ export const rule = {
|
|||||||
describe: "云原神签到token获取"
|
describe: "云原神签到token获取"
|
||||||
},
|
},
|
||||||
cookiesDocHelp: {
|
cookiesDocHelp: {
|
||||||
reg: "^#*(米游社|cookies|米游币)帮助$",
|
reg: "^#*(米游社|cookies|米游币|stoken|Stoken)(帮助|教程|绑定)$",
|
||||||
describe: "cookies获取帮助"
|
describe: "cookies获取帮助"
|
||||||
},
|
},
|
||||||
yunHelp:{
|
yunHelp:{
|
||||||
@ -294,7 +294,6 @@ async function cookie(e) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let stokens=miHoYoApi.getStoken(e.user_id)
|
let stokens=miHoYoApi.getStoken(e.user_id)
|
||||||
console.log(stokens)
|
|
||||||
if (Object.keys(stokens).length>0) {
|
if (Object.keys(stokens).length>0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -337,7 +336,7 @@ async function getCookie(e) {
|
|||||||
}
|
}
|
||||||
export async function cookiesDocHelp(e) {
|
export async function cookiesDocHelp(e) {
|
||||||
let cookiesDoc = await getcookiesDoc()
|
let cookiesDoc = await getcookiesDoc()
|
||||||
e.reply("【cookies帮助】" + cookiesDoc + "\ncookies必须包含login_ticket获取后请私发机器人");
|
e.reply(`【${e.msg.replace(/帮助|教程|绑定/g,"")}帮助】${cookiesDoc}\ncookies必须包含login_ticket获取后请私发机器人`);
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
async function getcookiesDoc() {
|
async function getcookiesDoc() {
|
||||||
@ -518,7 +517,8 @@ const getyunToken=async function(e){
|
|||||||
try {
|
try {
|
||||||
let ck = fs.readFileSync(file, 'utf-8')
|
let ck = fs.readFileSync(file, 'utf-8')
|
||||||
ck = YAML.parse(ck)
|
ck = YAML.parse(ck)
|
||||||
e.devId=ck.devId;
e.yuntoken=ck.yuntoken;
|
e.devId=ck.devId;
|
||||||
|
e.yuntoken=ck.yuntoken;
|
||||||
return ck
|
return ck
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return ""
|
return ""
|
||||||
|
69
apps/user.js
69
apps/user.js
@ -215,58 +215,39 @@ export async function delSign(e) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
export async function updCookie(e) {
|
export async function updCookie(e) {
|
||||||
let user = new User(e);
|
let stoken=await gsCfg.getBingStoken();
|
||||||
await user.getCookie(e)
|
if (Object.keys(stoken).length==0) {
|
||||||
if(isV3){
|
|
||||||
let {
|
|
||||||
checkAuth
|
|
||||||
} = (await import(`file:///${_path}/plugins/xiaoyao-cvs-plugin/adapter/mys.js`))
|
|
||||||
let userCk = (await checkAuth(e, "cookie"))
|
|
||||||
e.uid = userCk.uid
|
|
||||||
}else{
|
|
||||||
// let {
|
|
||||||
// MysUser
|
|
||||||
// } = (await import(`file:///${_path}/lib/components/Models.js`))
|
|
||||||
// console.log(MysUser)
|
|
||||||
// let uid =await MysUser.getUidByCookie();
|
|
||||||
// console.log(uid)
|
|
||||||
|
|
||||||
// let {
|
|
||||||
// bing
|
|
||||||
// } = (await import(`file:///${_path}/lib/app/gachaLog.js`))
|
|
||||||
// let userCk = (await checkAuth(e, "cookie"))
|
|
||||||
// e.uid = userCk.uid
|
|
||||||
e.reply("暂不支持V2")
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
let miHoYoApi = new MihoYoApi(e);
|
|
||||||
if (!e.cookies || e.cookies.includes("undefined")) {
|
|
||||||
e.reply("请先绑定stoken")
|
e.reply("请先绑定stoken")
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
let resObj = await miHoYoApi.updCookie();
|
let stokenData=stoken[0]
|
||||||
if (!resObj?.data) {
|
let miHoYoApi = new MihoYoApi(e);
|
||||||
e.reply(`请求异常:${resObj.message}`)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let sendMsg = [];
|
let sendMsg = [];
|
||||||
e._reply = e.reply;
|
e._reply = e.reply;
|
||||||
e.reply = (msg) => {
|
e.reply = (msg) => {
|
||||||
sendMsg.push(msg)
|
sendMsg.push(msg)
|
||||||
}
|
}
|
||||||
let sk = await utils.getCookieMap(e.cookies)
|
for(let item of Object.keys(stokenData)){
|
||||||
let ck = resObj["data"]["cookie_token"];
|
miHoYoApi.cookies= `stuid=${stokenData[item].stuid};stoken=${stokenData[item].stoken};ltoken=${stokenData[item].ltoken};`;
|
||||||
e.msg = `ltoken=${sk.get("ltoken")};ltuid=${sk.get("stuid")};cookie_token=${ck}; account_id=${sk.get("stuid")};`
|
let resObj = await miHoYoApi.updCookie();
|
||||||
if (isV3) {
|
if (!resObj?.data) {
|
||||||
let userck = (await import(`file:///${_path}/plugins/genshin/model/user.js`)).default
|
e._reply(`请求异常:${resObj.message}`)
|
||||||
e.ck = e.msg;
|
return false;
|
||||||
await (new userck(e)).bing()
|
}
|
||||||
} else {
|
let sk = await utils.getCookieMap(miHoYoApi.cookies)
|
||||||
let {
|
let ck = resObj["data"]["cookie_token"];
|
||||||
bingCookie
|
e.msg = `ltoken=${sk.get("ltoken")};ltuid=${sk.get("stuid")};cookie_token=${ck}; account_id=${sk.get("stuid")};`
|
||||||
} = (await import(`file:///${_path}/lib/app/dailyNote.js`))
|
if (isV3) {
|
||||||
e.isPrivate = true;
|
let userck = (await import(`file:///${_path}/plugins/genshin/model/user.js`)).default
|
||||||
await bingCookie(e)
|
e.ck = e.msg;
|
||||||
|
await (new userck(e)).bing()
|
||||||
|
} else {
|
||||||
|
let {
|
||||||
|
bingCookie
|
||||||
|
} = (await import(`file:///${_path}/lib/app/dailyNote.js`))
|
||||||
|
e.isPrivate = true;
|
||||||
|
await bingCookie(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await utils.replyMake(e, sendMsg, 0)
|
await utils.replyMake(e, sendMsg, 0)
|
||||||
return true;
|
return true;
|
||||||
|
@ -13,13 +13,12 @@ import {
|
|||||||
} from '../../components/Changelog.js';
|
} from '../../components/Changelog.js';
|
||||||
import fetch from "node-fetch"
|
import fetch from "node-fetch"
|
||||||
|
|
||||||
const APP_VERSION = "2.35.2";
|
const APP_VERSION = "2.36.1";
|
||||||
const mhyVersion = "2.11.1";
|
const mhyVersion = "2.11.1";
|
||||||
const salt = "ZSHlXeQUBis52qD1kEgKt5lUYed4b7Bb";
|
const salt = "n0KjuIrKgLHh08LWSCYP0WXlVXaYvV64";
|
||||||
const salt2 = "t0qEgfub6cvueAPgR5m9aQWWVciEer7v";
|
const salt2 = "t0qEgfub6cvueAPgR5m9aQWWVciEer7v";
|
||||||
const saltWeb = "N50pqm7FSy2AkFz2B3TqtuZMJ5TOl3Ep";
|
const saltWeb = "YVEIkzDFNHLeKXLxzqCA9TzxCpWwbIbk";
|
||||||
const oldsalt = "z8DRIUjNDT7IT5IZXvrUAxyupA1peND9";
|
const oldsalt = "z8DRIUjNDT7IT5IZXvrUAxyupA1peND9";
|
||||||
//b253c83ab2609b1b600eddfe974df47b
|
|
||||||
const DEVICE_ID = utils.randomString(32).toUpperCase();
|
const DEVICE_ID = utils.randomString(32).toUpperCase();
|
||||||
const DEVICE_NAME = utils.randomString(_.random(1, 10));
|
const DEVICE_NAME = utils.randomString(_.random(1, 10));
|
||||||
const _path = process.cwd();
|
const _path = process.cwd();
|
||||||
|
Loading…
Reference in New Issue
Block a user