2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-23 03:20:52 +08:00

补充cookies绑定逻辑

This commit is contained in:
Ctrlcvs 2022-12-18 11:05:36 +08:00
parent 9d00ac32b0
commit bda5cfc2d3
2 changed files with 6 additions and 5 deletions

View File

@ -74,7 +74,7 @@ export async function getBasicVoide(e) {
return true return true
} }
export async function roleInfo(e) { export async function roleInfo(e) {
let msg = e.msg.replace(/#||信息|图鉴|命座|天赋|原牌|七圣|动态|幻影/g, ""); let msg = e.msg.replace(/#||信息|图鉴|命座|天赋|原牌|七圣|动态|幻影|七圣召唤/g, "");
let Botcfg, id, type = 'juese_tujian'; let Botcfg, id, type = 'juese_tujian';
if (isV3) { if (isV3) {
Botcfg = (await import(`file://${_path}/plugins/genshin/model/gsCfg.js`)).default; Botcfg = (await import(`file://${_path}/plugins/genshin/model/gsCfg.js`)).default;

View File

@ -235,7 +235,6 @@ export default class user {
return res; return res;
} }
async bbsSeachSign() { async bbsSeachSign() {
let message = '';
let res = await this.getData("bbsisSign", { let res = await this.getData("bbsisSign", {
name: "原神" name: "原神"
}) })
@ -627,7 +626,7 @@ export default class user {
return validate return validate
} else if (res?.data?.result !== "slide") { } else if (res?.data?.result !== "slide") {
await redis.set(`xiaoyao:sign`, 1, { //写入缓存 过不了了 await redis.set(`xiaoyao:sign`, 1, { //写入缓存 过不了了
EX: 60 * 6 //等6分钟后再给用指令 避免ddos EX: 60 * 6 //等6分钟后再给用指令
}); });
} }
return "" return ""
@ -763,9 +762,11 @@ export default class user {
// 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')}`
// } // }
} else { } else {
this.e.cookie = this.e.original_msg this.e.cookie = this.e.original_msg //发送的为cookies
this.cookies=`stuid=${this.e.stuid};stoken=${data?.data?.list[0].token};ltoken=${data?.data?.list[1].token}`
res=await this.getData('getLtoken',{cookies:this.cookies},false)
v2Sk=await this.getData('getByStokenV2',{headers:{Cookie:this.cookies}},false)
} }
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) {