mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
@@ -10,7 +10,8 @@ const MysApi = {
|
||||
Lottery: "https://bbs-api.miyoushe.com/painter/wapi/lottery/user/show?id={lotteryId}",
|
||||
News: "https://bbs-api.mihoyo.com/post/wapi/getNewsList?gids={gid}&page_size={pageSize}&type={newsType}&last_id={lastId}",
|
||||
Forum:
|
||||
"https://bbs-api.miyoushe.com/post/wapi/getForumPostList?forum_id={forum}&gids={gid}&sort_type={type}",
|
||||
"https://bbs-api.miyoushe.com/post/wapi/getForumPostList?forum_id={forum}&gids={gid}&sort_type={type}&page_size=20",
|
||||
Navigator: "https://bbs-api.miyoushe.com/apihub/api/home/new?gids={gid}",
|
||||
Position: "https://api-static.mihoyo.com/common/blackboard/ys_obc/v1/home/position?app_sn=ys_obc",
|
||||
Post: {
|
||||
Api: "https://bbs-api.mihoyo.com/post/wapi/getPostFull?post_id={postId}",
|
||||
|
||||
@@ -8,6 +8,7 @@ import MysApi from "./api";
|
||||
import { getLoginQr, getLoginStatus } from "./request/doGameLogin";
|
||||
import getForumList from "./request/getForumList";
|
||||
import getGachaData from "./request/getGachaData";
|
||||
import getHomeNavigator from "./request/getHomeNavigator";
|
||||
import getLotteryData from "./request/getLotteryData";
|
||||
import getNewsList from "./request/getNewsList";
|
||||
import getPositionData from "./request/getPositionData";
|
||||
@@ -25,6 +26,7 @@ const Mys = {
|
||||
Posts: {
|
||||
get: getForumList,
|
||||
card: getNewsCard,
|
||||
nav: getHomeNavigator,
|
||||
},
|
||||
Gacha: {
|
||||
get: getGachaData,
|
||||
|
||||
24
src/plugins/Mys/request/getHomeNavigator.ts
Normal file
24
src/plugins/Mys/request/getHomeNavigator.ts
Normal 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;
|
||||
Reference in New Issue
Block a user