!66 修改七圣卡组查询优先级,将请求device_fp标记为仅使用自己的ck

Merge pull request !66 from 帮帮/master
This commit is contained in:
Kokomi 2023-07-17 19:32:34 +00:00 committed by Gitee
commit 53b33d13e8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 10 additions and 20 deletions

View File

@ -8,14 +8,14 @@ export class sevenSaints extends plugin {
name: '七圣召唤卡组查询', name: '七圣召唤卡组查询',
dsc: '原神角色信息查询', dsc: '原神角色信息查询',
event: 'message', event: 'message',
priority: 5000, priority: 0,
rule: [ rule: [
{ {
reg: '^#*七圣(召唤)?(牌|卡)组(列表)?[0-9]{0,2}$', reg: '^#*七圣(召唤)?查询(牌|卡)组(列表)?[0-9]{0,2}$',
fnc: 'deckIndex' fnc: 'deckIndex'
}, },
{ {
reg: '^#*七圣(召唤)?(角色|行动)?(卡)?牌(列表)?$', reg: '^#*七圣(召唤)?查询(角色|行动)?(卡)?牌(列表)?$',
fnc: 'deck_cards' fnc: 'deck_cards'
} }
] ]

View File

@ -10,21 +10,8 @@ export default class Deck extends base {
this.headIndexStyle = `<style> .head_box { background: url(${this.screenData.pluResPath}img/roleIndex/namecard/${lodash.random(1, 8)}.png) #f5f5f5; background-position-x: 30px; background-repeat: no-repeat; border-radius: 15px; font-family: tttgbnumber; padding: 10px 20px; position: relative; background-size: auto 101%; }</style>` this.headIndexStyle = `<style> .head_box { background: url(${this.screenData.pluResPath}img/roleIndex/namecard/${lodash.random(1, 8)}.png) #f5f5f5; background-position-x: 30px; background-repeat: no-repeat; border-radius: 15px; font-family: tttgbnumber; padding: 10px 20px; position: relative; background-size: auto 101%; }</style>`
} }
async getdata(api) {
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, api, {
headers: {
'x-rpc-device_fp': device_fp?.data?.device_fp
}
})
return res
}
async getIndex(id, list = false) { async getIndex(id, list = false) {
let res = await this.getdata('deckList') let res = await MysInfo.get(this.e, 'deckList')
if (res?.retcode !== 0) return false if (res?.retcode !== 0) return false
let Data let Data
@ -58,7 +45,7 @@ export default class Deck extends base {
let res = {} let res = {}
for (let api of ['basicInfo', 'avatar_cardList', 'action_cardList']) { for (let api of ['basicInfo', 'avatar_cardList', 'action_cardList']) {
if ((id == 2 && api == 'avatar_cardList') || (id == 1 && api == 'action_cardList')) continue if ((id == 2 && api == 'avatar_cardList') || (id == 1 && api == 'action_cardList')) continue
res[api] = (await this.getdata(api)).data res[api] = (await MysInfo.get(this.e, api)).data
} }
this.model = 'deckCard' this.model = 'deckCard'

View File

@ -25,7 +25,7 @@ export default class MysInfo {
} }
// ck对应MysUser对象 // ck对应MysUser对象
this.ckUser = null this.ckUser = null
this.auth = ['dailyNote', 'bbs_sign_info', 'bbs_sign_home', 'bbs_sign', 'ys_ledger', 'compute', 'avatarSkill', 'detail', 'blueprint', 'UserGame', 'deckList', 'avatar_cardList', 'action_cardList'] this.auth = ['dailyNote', 'bbs_sign_info', 'bbs_sign_home', 'bbs_sign', 'ys_ledger', 'compute', 'avatarSkill', 'detail', 'blueprint', 'UserGame', 'getFp', 'deckList', 'avatar_cardList', 'action_cardList']
} }
static async init(e, api) { static async init(e, api) {

View File

@ -43,6 +43,9 @@
</div> </div>
</div> </div>
</div> </div>
{{if !avatar_cardList && !action_cardList}}
<div class="logo">请绑定cookie后查看更多信息</div>
{{/if}}
</div> </div>
{{/if}} {{/if}}
<div style="height: 5px;"></div> <div style="height: 5px;"></div>

View File

@ -29,7 +29,7 @@
{{each Data vals}} {{each Data vals}}
<div class="basicInfo"> <div class="basicInfo">
<div class="tab_lable">七圣卡组{{vals.id}} 使用#七圣卡组{{vals.id}}查看详情</div> <div class="tab_lable">七圣卡组{{vals.id}} 使用#七圣查询卡组{{vals.id}}查看详情</div>
<div style="height: 10px;"></div> <div style="height: 10px;"></div>
<div class="avatar_covers"> <div class="avatar_covers">
{{each vals.avatar_cards val}} {{each vals.avatar_cards val}}