mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-13 16:27:26 +08:00
[O] Encapsulate all music
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {aqua_host} from "./config";
|
||||
import {aqua_host, data_host} from "./config";
|
||||
import type {TrendEntry} from "./generalTypes";
|
||||
import type {MaimaiUserSummaryEntry} from "./maimaiTypes";
|
||||
|
||||
@@ -32,6 +32,10 @@ export async function getMaimai(endpoint: string, params: any) {
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
export async function getMaimaiAllMusic(): Promise<{ [key: string]: any }> {
|
||||
return fetch(`${data_host}/maimai/meta/00/all-music.json`).then(it => it.json())
|
||||
}
|
||||
|
||||
export async function getMaimaiApi(endpoint: string, params: any) {
|
||||
let url = new URL(`${aqua_host}/api/game/maimai2new/${endpoint}`)
|
||||
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]))
|
||||
|
||||
Reference in New Issue
Block a user