删除多余的fp

This commit is contained in:
bbaban 2023-10-10 13:29:59 +08:00
parent fc299a9628
commit 3e8e30f329
5 changed files with 16 additions and 21 deletions

View File

@ -53,7 +53,7 @@ export default class blueprint extends base {
}
async computes (body) {
let computes = await this.mysApi.getData('blueprintCompute', body)
let computes = await this.mysApi.getData('blueprintCompute', { body })
if (!computes || computes.retcode !== 0) return false
computes = computes.data?.list
return computes

View File

@ -26,10 +26,7 @@ export default class Calculator extends base {
this.mysApi = new MysApi(uid, ck.ck, { log: true })
let seed_id = lodash.sample('abcdefghijklmnopqrstuvwxyz0123456789', 16).replace(/,/g, '')
let device_fp = await MysInfo.get(this.e, 'getFp', {
seed_id
})
let device_fp = await MysInfo.get(this.e, 'getFp')
this.headers = {
'x-rpc-device_fp': device_fp?.data?.device_fp
}
@ -243,7 +240,10 @@ export default class Calculator extends base {
}
async computes(body) {
let computes = await MysInfo.get(this.e, 'compute', body)
let computes = await MysInfo.get(this.e, 'compute', {
body,
headers: this.headers
})
if (!computes || computes.retcode !== 0) return false
computes = computes.data

View File

@ -66,11 +66,11 @@ export default class apiTool {
/** 养成计算器 */
compute: {
url: `${host}event/e20200928calculate/v2/compute`,
body: data
body: data.body
},
blueprintCompute: {
url: `${host}event/e20200928calculate/v1/furniture/compute`,
body: data
body: data.body
},
/** 养成计算器 */
blueprint: {
@ -178,7 +178,7 @@ export default class apiTool {
compute: {
url: `${host}event/rpgcalc/compute?`,
query:`game=hkrpg`,
body: data
body: data.body
},
/** 详情 */
detail: {
@ -197,7 +197,7 @@ export default class apiTool {
urlMap.genshin.blueprint.url = 'https://sg-public-api.hoyolab.com/event/calculateos/furniture/blueprint'
urlMap.genshin.blueprint.query = `share_code=${data.share_code}&region=${this.server}&lang=zh-cn`
urlMap.genshin.blueprintCompute.url = 'https://sg-public-api.hoyolab.com/event/calculateos/furniture/compute'
urlMap.genshin.blueprintCompute.body = { lang: 'zh-cn', ...data }
urlMap.genshin.blueprintCompute.body = { lang: 'zh-cn', ...data.body }
urlMap.genshin.ys_ledger.url = 'https://hk4e-api-os.mihoyo.com/event/ysledgeros/month_info'// 支持了国际服札记
urlMap.genshin.ys_ledger.query = `lang=zh-cn&month=${data.month}&uid=${this.uid}&region=${this.server}`
urlMap.genshin.useCdk.url = 'https://sg-hk4e-api.hoyoverse.com/common/apicdkey/api/webExchangeCdkey'

View File

@ -162,7 +162,7 @@ export default class MysInfo {
let mysApi = new MysApi(mysInfo.uid, mysInfo.ckInfo.ck, option, e.isSr, user.device)
let device_fp = ''
if (!data?.headers?.['x-rpc-device_fp']) {
if (!data?.headers?.['x-rpc-device_fp'] && api !== 'getFp') {
device_fp = (await mysApi.getData('getFp')).data?.device_fp
if (data?.headers) {
data.headers['x-rpc-device_fp'] = device_fp

View File

@ -16,15 +16,10 @@ export default class Note extends base {
}
async getData () {
let seed_id = lodash.sample('abcdefghijklmnopqrstuvwxyz0123456789', 16).replace(/,/g, '')
let device_fp = await MysInfo.get(this.e, 'getFp', {
seed_id
})
let res = await MysInfo.get(this.e, 'dailyNote', {
headers: {
'x-rpc-device_fp': device_fp?.data?.device_fp
}
})
let device_fp = await MysInfo.get(this.e, 'getFp')
let headers= {'x-rpc-device_fp': device_fp?.data?.device_fp}
let res = await MysInfo.get(this.e, 'dailyNote', { headers })
let resUser
if (!res || res.retcode !== 0) return false
@ -33,7 +28,7 @@ export default class Note extends base {
let screenData = this.screenData
if (this.e.isSr) {
resUser = await MysInfo.get(this.e, 'UserGame')
resUser = await MysInfo.get(this.e, 'UserGame', { headers })
resUser.data?.list?.forEach(v => this.e.uid.includes(v.game_biz))
if (!resUser || resUser.retcode !== 0) return false
}