mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
姑且先把能过的 ts 文件给过了,明天再过其余的 ts 文件跟 vue Signed-off-by: BTMuli <BT-Muli@outlook.com> (cherry picked from commit b7392bddea895b8b8cc1cad5ba0403d2dc738643)
31 lines
743 B
TypeScript
31 lines
743 B
TypeScript
/**
|
|
* @file plugins Mys request gacha.ts
|
|
* @description Mys抽卡请求
|
|
* @author BTMuli<bt-muli@outlook.com>
|
|
* @since Alpha
|
|
*/
|
|
|
|
import { http } from "@tauri-apps/api";
|
|
import { type GachaResponse, type GachaData } from "../interface/gacha";
|
|
|
|
// 卡池 API
|
|
const GACHA_POOL_API = "https://api-takumi.mihoyo.com/common/blackboard/ys_obc/v1/gacha_pool?app_sn=ys_obc";
|
|
|
|
/**
|
|
* @description 获取卡池信息
|
|
* @since Alpha
|
|
* @return {Promise<GachaData[]>}
|
|
*/
|
|
export async function getGachaData (): Promise<GachaData[]> {
|
|
return await http
|
|
.fetch<GachaResponse>(GACHA_POOL_API, {
|
|
method: "GET",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
})
|
|
.then((res) => {
|
|
return res.data.data.list;
|
|
});
|
|
}
|