mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
♻️ 姑且没登录的功能都给试了下
This commit is contained in:
@@ -1,26 +1,23 @@
|
||||
/**
|
||||
* @file plugins Hutao request getTeamCollect.ts
|
||||
* @file plugins/Hutao/request/getTeamCollect.ts
|
||||
* @description 获取队伍搭配数据
|
||||
* @since Alpha v0.2.0
|
||||
* @since Beta v0.5.0
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
import type { Response } from "@tauri-apps/api/http";
|
||||
|
||||
import TGHttp from "../../../utils/TGHttp.js";
|
||||
import HutaoApi from "../api/index.js";
|
||||
|
||||
/**
|
||||
* @description 获取队伍搭配数据
|
||||
* @since Alpha v0.2.0
|
||||
* @since Beta v0.5.0
|
||||
* @return {Promise<TGApp.Plugins.Hutao.Abyss.TeamCombination[]>}
|
||||
*/
|
||||
async function getTeamCollect(): Promise<TGApp.Plugins.Hutao.Abyss.TeamCombination[]> {
|
||||
const url = HutaoApi.Abyss.team;
|
||||
return await http
|
||||
.fetch(url, { method: "GET" })
|
||||
.then((res: Response<TGApp.Plugins.Hutao.Abyss.TeamCombinationResponse>) => {
|
||||
return res.data.data;
|
||||
});
|
||||
const resp = await TGHttp<TGApp.Plugins.Hutao.Abyss.TeamCombinationResponse>(url, {
|
||||
method: "GET",
|
||||
});
|
||||
return resp.data;
|
||||
}
|
||||
|
||||
export default getTeamCollect;
|
||||
|
||||
Reference in New Issue
Block a user