2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-22 19:10:53 +08:00

修正国际服绑定stoken错误问题

This commit is contained in:
Ctrlcvs 2022-11-21 11:31:03 +08:00
parent c67bafca20
commit f815af154a
3 changed files with 15 additions and 6 deletions

View File

@ -100,8 +100,8 @@ export default class miHoYoApi {
Bot.logger.error(`[接口][${type}][${this.e.uid}] ${response.status} ${response.statusText}`) Bot.logger.error(`[接口][${type}][${this.e.uid}] ${response.status} ${response.statusText}`)
return false return false
} }
// Bot.logger.mark(`[接口][${type}][${this.e.uid}] ${Date.now() - start}ms`)
let res = await response.text(); let res = await response.text();
//Bot.logger.mark(`[接口][${type}][${this.e.uid}] ${Date.now() - start}ms\n${res}`)
if (res.startsWith('(')) { if (res.startsWith('(')) {
res = JSON.parse((res).replace(/\(|\)/g, "")) res = JSON.parse((res).replace(/\(|\)/g, ""))
} else { } else {
@ -122,7 +122,7 @@ export default class miHoYoApi {
let urlMap = { let urlMap = {
userGameInfo: { //通用查询 userGameInfo: { //通用查询
url: `${this.apiMap.apiWeb}/binding/api/getUserGameRolesByCookie`, url: `${this.apiMap.apiWeb}/binding/api/getUserGameRolesByCookie`,
query: `game_biz=${board?.biz}`, query: `game_biz=${this.isOs?board?.osbiz:board?.biz}`,
types: 'sign' types: 'sign'
}, },
isSign: board?.signUrl(data, "isSign", this.apiMap.apiWeb) || {}, isSign: board?.signUrl(data, "isSign", this.apiMap.apiWeb) || {},
@ -153,6 +153,10 @@ export default class miHoYoApi {
bbsCaptchaVerify: { bbsCaptchaVerify: {
url: `${mys.bbs_api}/misc/api/verifyVerification` url: `${mys.bbs_api}/misc/api/verifyVerification`
}, },
bbsCaptchaVerify: {
url: `https://api.geetest.com/gettype.php`,
query:``
},
//待定接口 用于获取用户米游社顶部的模块栏 //待定接口 用于获取用户米游社顶部的模块栏
bbs_Businesses_url: { bbs_Businesses_url: {
url: `${mys.bbs_api}/user/api/getUserBusinesses`, url: `${mys.bbs_api}/user/api/getUserBusinesses`,
@ -216,6 +220,7 @@ export default class miHoYoApi {
types: 'cloud' types: 'cloud'
}, },
authKey: { authKey: {
///account/auth/api/genAuthKey
url: `${this.apiMap.apiWeb}/binding/api/genAuthKey`, url: `${this.apiMap.apiWeb}/binding/api/genAuthKey`,
body: { body: {
'auth_appid': 'webview_gacha', 'auth_appid': 'webview_gacha',
@ -252,6 +257,7 @@ export default class miHoYoApi {
header = { header = {
'Cookie': this.cookies, 'Cookie': this.cookies,
"x-rpc-channel": "miyousheluodi", "x-rpc-channel": "miyousheluodi",
"x-rpc-auto_test": true,
'x-rpc-device_id': DEVICE_ID, 'x-rpc-device_id': DEVICE_ID,
'x-rpc-app_version': mys.APP_VERSION, 'x-rpc-app_version': mys.APP_VERSION,
"x-rpc-device_model": "Mi 10", "x-rpc-device_model": "Mi 10",
@ -264,7 +270,6 @@ export default class miHoYoApi {
"x-rpc-sys_version": "12", "x-rpc-sys_version": "12",
"Host": "bbs-api.mihoyo.com", "Host": "bbs-api.mihoyo.com",
"User-Agent": "okhttp/4.8.0", "User-Agent": "okhttp/4.8.0",
// 'DS': `1602569298,k0xfEh,07f4545f5d88eac59cb1257aef74a570`
} }
break; break;
case "sign": case "sign":
@ -287,11 +292,14 @@ export default class miHoYoApi {
app_version: '2.9.0', app_version: '2.9.0',
User_Agent: `Mozilla/5.0 (Linux; Android 9.0; SAMSUNG SM-F900U Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.73 Mobile Safari/537.36 miHoYoBBSOversea/2.9.0`, User_Agent: `Mozilla/5.0 (Linux; Android 9.0; SAMSUNG SM-F900U Build/PPR1.180610.011) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.73 Mobile Safari/537.36 miHoYoBBSOversea/2.9.0`,
client_type: '2', client_type: '2',
'x-rpc-app_version': '2.9.0',
Origin: 'https://webstatic-sea.hoyolab.com', Origin: 'https://webstatic-sea.hoyolab.com',
X_Requested_With: 'com.mihoyo.hoyolab', X_Requested_With: 'com.mihoyo.hoyolab',
Referer: 'https://webstatic-sea.hoyolab.com' Referer: 'https://webstatic-sea.hoyolab.com',
DS: this.getDs(),
'Cookie': this.cookie
} }
header = Object.assign({}, header, os_Header) header = os_Header
} }
break; break;
case "cloud": case "cloud":

View File

@ -58,6 +58,7 @@ const boards = {
forumid: 26, forumid: 26,
key: 'genshin', key: 'genshin',
biz: 'hk4e_cn', biz: 'hk4e_cn',
osbiz:'hk4e_global',
actid: 'e202009291139501', actid: 'e202009291139501',
name: '原神', name: '原神',
url: "https://bbs.mihoyo.com/ys/", url: "https://bbs.mihoyo.com/ys/",

View File

@ -740,7 +740,6 @@ export default class user {
} }
async seachUid(data) { async seachUid(data) {
if (data?.data) { if (data?.data) {
let datalist = {}
let res; let res;
if (this.e.sk) { if (this.e.sk) {
this.e.cookie = this.e.cookie =
@ -751,6 +750,7 @@ export default class user {
res = await this.getData("userGameInfo", this.ForumData[1], false) res = await this.getData("userGameInfo", this.ForumData[1], false)
let uids=[] let uids=[]
for (let s of res.data.list) { for (let s of res.data.list) {
let datalist = {}
let uid = s.game_uid let uid = s.game_uid
uids.push(uid) uids.push(uid)
datalist[uid] = { datalist[uid] = {