完成多游戏多频道多排序帖子获取

close #67
This commit is contained in:
BTMuli
2023-12-09 17:29:13 +08:00
parent f998ba21b3
commit 1ccb99dd1b
5 changed files with 601 additions and 47 deletions

View File

@@ -0,0 +1,24 @@
/**
* @file plugins/Mys/request/getHomeNavigator.ts
* @description Mys 插件首页导航请求
* @since Beta v0.3.7
*/
import { http } from "@tauri-apps/api";
import MysApi from "../api";
/**
* @description 获取首页导航列表
* @since Beta v0.3.7
* @param {number} gid GID
* @return {Promise<TGApp.BBS.Navigator.Navigator[]>}
*/
async function getHomeNavigator(gid: number = 2): Promise<TGApp.BBS.Navigator.Navigator[]> {
const url = MysApi.Navigator.replace("{gid}", gid.toString());
return await http
.fetch<TGApp.BBS.Navigator.HomeResponse>(url)
.then((res) => res.data.data.navigator);
}
export default getHomeNavigator;