mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2024-12-23 03:20:52 +08:00
修正账密登录sk问题(#46) 、去除验证码token
This commit is contained in:
parent
8c4d57b2f6
commit
57f4ae0835
@ -37,3 +37,5 @@ noteSetAuth: 2
|
||||
noteTask: 0 0/10 * * * ?
|
||||
# 全局开关体力推送 关闭后不可操作体力推送相关内容 true开启 false 关闭
|
||||
isNoteTask: false
|
||||
# 验证码接口token
|
||||
getToken:
|
@ -81,7 +81,6 @@ export default class mysTopLogin {
|
||||
Bot.logger.mark("[米哈游登录] 正在验证")
|
||||
this.aigis_captcha_data = JSON.parse(res.aigis_data.data)
|
||||
let vlData = await this.crack_geetest()
|
||||
console.log(vlData)
|
||||
// let validate = await this.user.getData("validate", this.aigis_captcha_data, false)
|
||||
if (vlData?.geetest_validate) {
|
||||
Bot.logger.mark("[米哈游登录] 验证成功")
|
||||
@ -104,12 +103,12 @@ export default class mysTopLogin {
|
||||
}
|
||||
if (res.retcode == 0) {
|
||||
let cookies = `stoken=${res.data.token.token}&mid=${res.data.user_info.mid}`
|
||||
let cookie_token = this.user.getData("bbsGetCookie", { cookies })
|
||||
let ltoken = await this.user.getData('getLtoken', { cookies: `${cookies};stuid=${res.data.user_info.aid};` }, false)
|
||||
let cookie_token =await this.user.getData("bbsGetCookie", { cookies })
|
||||
let ltoken = await this.user.getData('getLtoken', { cookies: `${cookies}` }, false)
|
||||
Bot.logger.mark(`[米哈游登录] ${Bot.logger.blue(JSON.stringify(cookie_token))}`)
|
||||
return {
|
||||
cookie: `ltoken=${ltoken?.data?.ltoken};ltuid=${res.data.user_info.aid};cookie_token=${cookie_token?.data?.cookie_token};`,
|
||||
stoken: `${cookies};stuid=${res.data.user_info.aid};`
|
||||
stoken: `${cookies.replace('&',';')};stuid=${res.data.user_info.aid};`
|
||||
}
|
||||
} else {
|
||||
await this.e.reply(`错误:${JSON.stringify(res)}`, true)
|
||||
|
@ -209,10 +209,10 @@ export default class miHoYoApi {
|
||||
query: `login_ticket=${data.loginTicket}&token_types=3&uid=${data.loginUid}`,
|
||||
types: 'stoken'
|
||||
},
|
||||
//接口来源于外网扒来的 接口目前暂时免费后续看token是否收费,祝你生活愉快
|
||||
//很抱歉由于有人恶意倒卖,不得已只能是关闭免费token了 开放免费供人使用还被恶意倒卖指责 开源确实不好弄捏
|
||||
validate: {
|
||||
url: `http://api.fuckmys.tk/geetest`,
|
||||
query: `token=fuckmys>=${data.gt}&challenge=${data.challenge}`
|
||||
query: `token=${data?.getToken}>=${data.gt}&challenge=${data.challenge}`
|
||||
},
|
||||
cloudLogin: {
|
||||
url: `${mys.cloud_api}/hk4e_cg_cn/gamer/api/login`,
|
||||
@ -259,7 +259,7 @@ export default class miHoYoApi {
|
||||
query: `callback=${data.challenge}`
|
||||
},
|
||||
loginByPassword: {
|
||||
url: "https://passport-api.mihoyo.com/account/ma-cn-passport/app/loginByPassword",
|
||||
url: `${mys.pass_api}/account/ma-cn-passport/app/loginByPassword`,
|
||||
body: {
|
||||
account: this.encrypt_data(data.account),
|
||||
password: this.encrypt_data(data.password)
|
||||
@ -267,14 +267,14 @@ export default class miHoYoApi {
|
||||
types: 'pass'
|
||||
},
|
||||
qrCodeLogin: {
|
||||
url: `https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/fetch`,
|
||||
url: `${mys.hk4_sdk}/hk4e_cn/combo/panda/qrcode/fetch`,
|
||||
body: {
|
||||
app_id: mys.app_id,
|
||||
device: data.device
|
||||
}
|
||||
},
|
||||
qrCodeQuery: {
|
||||
url: `https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/query`,
|
||||
url: `${mys.hk4_sdk}/hk4e_cn/combo/panda/qrcode/query`,
|
||||
body: {
|
||||
app_id: mys.app_id,
|
||||
device: data.device,
|
||||
@ -282,7 +282,7 @@ export default class miHoYoApi {
|
||||
}
|
||||
},
|
||||
getTokenByGameToken: {
|
||||
url: `https://passport-api.mihoyo.com/account/ma-cn-session/app/getTokenByGameToken`,
|
||||
url: `${mys.pass_api}/account/ma-cn-session/app/getTokenByGameToken`,
|
||||
body: {
|
||||
account_id: data.uid * 1,
|
||||
game_token: data.token
|
||||
@ -290,7 +290,7 @@ export default class miHoYoApi {
|
||||
types: 'pass'
|
||||
},
|
||||
getCookieAccountInfoByGameToken: {
|
||||
url: `https://api-takumi.mihoyo.com/auth/api/getCookieAccountInfoByGameToken`,
|
||||
url: `${mys.web_api}/auth/api/getCookieAccountInfoByGameToken`,
|
||||
query: `account_id=${data.uid}&game_token=${data.token}`
|
||||
},
|
||||
GetCode:{
|
||||
|
@ -11,6 +11,7 @@ const web_api = `https://api-takumi.mihoyo.com`
|
||||
const os_web_api = `https://api-os-takumi.mihoyo.com`
|
||||
const os_hk4_api = `https://hk4e-api-os.hoyoverse.com`;
|
||||
const hk4_api = `https://hk4e-api.mihoyo.com`;
|
||||
const hk4_sdk = `https://hk4e-sdk.mihoyo.com`;
|
||||
const bbs_api = `https://bbs-api.mihoyo.com`;
|
||||
const cloud_api = `https://api-cloudgame.mihoyo.com`
|
||||
const pass_api = `https://passport-api.mihoyo.com`
|
||||
@ -224,7 +225,7 @@ export default {
|
||||
web_api,
|
||||
os_web_api,
|
||||
os_hk4_api, app_id,
|
||||
hk4_api,
|
||||
hk4_api,hk4_sdk,
|
||||
bbs_api, publicKey,
|
||||
pass_api, passSalt,
|
||||
boards
|
||||
|
@ -30,8 +30,10 @@ export default class user {
|
||||
this.ForumData = Data.readJSON(`${_path}/plugins/xiaoyao-cvs-plugin/defSet/json`, "mys")
|
||||
this.configSign = gsCfg.getfileYaml(`${_path}/plugins/xiaoyao-cvs-plugin/config/`, "config");
|
||||
this.configSign.signlist = this.configSign.signlist || "原神|崩坏3|崩坏2|未定事件簿".split("|")
|
||||
this.getToken = this.configSign.getToken || ''
|
||||
this.getyunToken(this.e)
|
||||
}
|
||||
|
||||
async getCkData() {
|
||||
let sumData = {};
|
||||
let yunres = await this.cloudSeach();
|
||||
@ -200,6 +202,7 @@ export default class user {
|
||||
return this.configSign[type.includes("云") ? "cloudDoc" : "cookiesDoc"]
|
||||
}
|
||||
async cloudSign() {
|
||||
await this.cloudSeach()
|
||||
let res = await this.getData("cloudReward")
|
||||
if (res?.data?.list?.length == 0 || !res?.data?.list) {
|
||||
res.message = `您今天的奖励已经领取了~`
|
||||
@ -610,7 +613,8 @@ export default class user {
|
||||
try {
|
||||
let res = await this.getData('bbsGetCaptcha', false)
|
||||
// let challenge = res.data["challenge"]
|
||||
// await this.getData("geeType", res.data, false) //接入别的平台请把这段代码放出来 否则会一直出现提示拼图失效的情况
|
||||
// await this.getData("geeType", res.data, false)
|
||||
res.data.getToken=this.getToken
|
||||
res = await this.getData("validate", res.data, false)
|
||||
if (res?.data?.validate) {
|
||||
res = await this.getData("bbsCaptchaVerify", res.data, false)
|
||||
@ -625,6 +629,7 @@ export default class user {
|
||||
}
|
||||
async geetest(data) {
|
||||
try {
|
||||
data.getToken=this.getToken
|
||||
let res = await this.getData("validate", data, false)
|
||||
if (res?.data?.validate) {
|
||||
let validate = res?.data?.validate
|
||||
|
Loading…
Reference in New Issue
Block a user