mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Update medal API (#2341)
This commit is contained in:
parent
dabda01846
commit
85442453f3
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -176,7 +176,7 @@
|
||||
"mdi.min.js": "8A22F2F37F88F74FC07CE2FECA7CE135182058BE24409BAF3DEF0D5845B0BE1A",
|
||||
"medal-helper.min.css": "D27933BDA0CEAC6916271A9EAA0803342290207CC44AD1916B0244BE7BA3CBEE",
|
||||
"medal-helper.min.html": "5D7057259368BE97DED3375DD904695B245AA2BF338C5E18CB3CF61DD913617C",
|
||||
"medal-helper.min.js": "78B32AC5965B3C4A07571AB05AED7B3125F9CA33A67DFB7595FFBC2DB678FC8D",
|
||||
"medal-helper.min.js": "8EDA07A5DB9737437BAB9634712D536EE76B55F35DE758C126546849030B82F3",
|
||||
"menu-repeat-video.min.js": "A8A8CE04FC9B8B4118A2358488DE1BF5A9F576A24A657861426696C565EC7197",
|
||||
"minimal-home.vue.min.js": "DFA2E873F7948766950084DB5640A1299F63A6E45BAC943A3D1B9CB0E4A2E19F",
|
||||
"minimal-home-search.vue.min.js": "83ACE262CBA7CB68260746B25DD3009D12BA351220F5732BD74EF0B87CBB5D3A",
|
||||
|
||||
BIN
min/bundle.zip
BIN
min/bundle.zip
Binary file not shown.
2
min/medal-helper.min.js
vendored
2
min/medal-helper.min.js
vendored
File diff suppressed because one or more lines are too long
@ -20,19 +20,36 @@ class Medal extends Badge {
|
||||
roomID: number
|
||||
isLighted: boolean
|
||||
constructor(json: any) {
|
||||
const { medal_id, status, level, medalName, uname, roomid, is_lighted } = json
|
||||
super(status === 1, medal_id)
|
||||
const {
|
||||
medal: {
|
||||
medal_id,
|
||||
level,
|
||||
medal_name,
|
||||
wearing_status,
|
||||
is_lighted,
|
||||
},
|
||||
anchor_info: {
|
||||
nick_name,
|
||||
},
|
||||
room_info: {
|
||||
room_id,
|
||||
},
|
||||
} = json
|
||||
super(wearing_status === 1, medal_id)
|
||||
this.level = level
|
||||
this.name = medalName
|
||||
this.upName = uname
|
||||
this.roomID = roomid
|
||||
this.name = medal_name
|
||||
this.upName = nick_name
|
||||
this.roomID = room_id
|
||||
this.isLighted = is_lighted
|
||||
}
|
||||
static async getList(): Promise<Medal[]> {
|
||||
return Badge.parseJson(
|
||||
await Ajax.getTextWithCredentials("https://api.live.bilibili.com/i/api/medal?page=1&pageSize=256"),
|
||||
await Ajax.getTextWithCredentials(`https://api.live.bilibili.com/xlive/app-ucenter/v1/fansMedal/panel?page=1&page_size=256&target_id=${getUID()}`),
|
||||
{
|
||||
successAction: json => json.data.fansMedalList.map((it: any) => new Medal(it)),
|
||||
successAction: json => {
|
||||
const list: any[] = (json.data.list ?? []).concat(json.data.special_list ?? [])
|
||||
return list.map(it => new Medal(it))
|
||||
},
|
||||
errorAction: () => [],
|
||||
errorMessage: "无法获取勋章列表.",
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user