♻️ 部分分区动态获取,重构部分调用

This commit is contained in:
目棃
2025-01-17 16:06:36 +08:00
parent da78d27239
commit c9f74537b0
18 changed files with 216 additions and 185 deletions

View File

@@ -26,6 +26,20 @@ async function getAllGamesForums(): Promise<Array<TGApp.BBS.Forum.GameForum>> {
).data.list;
}
/**
* @description 获取所有分区
* @since Beta v0.6.8
* @return {Promise<Array<TGApp.BBS.Game.Item>>}
*/
async function getGameList(): Promise<Array<TGApp.BBS.Game.Item>> {
return (
await TGHttp<TGApp.BBS.Game.ListResp>(`${Mahwbu}getGameList`, {
method: "GET",
headers: { "Content-Type": "application/json", referer: Referer },
})
).data.list;
}
/**
* @description 获取投票信息
* @since Beta v0.6.2
@@ -80,6 +94,7 @@ const apiHubReq = {
vote: { info: getVotes, result: getVoteResult },
home: homeNew,
forum: getAllGamesForums,
game: getGameList,
};
export default apiHubReq;